2/02/2012

C# Number Pattern (14)

C# Number Pattern (14)
C# Number Pattern (14)

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

No comments:

Post a Comment