2/01/2012

C# Number Pattern (7)

C# Number Pattern (7)
C# Number Pattern (7)

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

No comments:

Post a Comment