2/02/2012

C# Number Pattern (11)

C# Number Pattern (11)
C# Number Pattern (11)

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

No comments:

Post a Comment