2/01/2012

C# Number Pattern (10)

C# Number Pattern (10)
C# Number Pattern (10)

 /* C# program to print the following pattern   
 5  
 44  
 333  
 2222  
 11111  */   
 namespace Patterns  
 {  
   class Program  
   {  
     static void Main(string[] args)  
     {  
       int i, j;  
       for (i = 5; i >= 1; i--)  
       {  
         for (j = 5; j >= i; j--)  
         {  
           Console.Write(i);  
         }  
         Console.WriteLine();  
       }        
     }  
   }  
 }  

No comments:

Post a Comment