2/01/2012

C# Number Pattern (6)

C# Number Pattern (6)
C# Number Pattern (6)

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

No comments:

Post a Comment