2/02/2012

C# Number Pattern (19)

C# Number Pattern (19)
C# Number Pattern (19)

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

No comments:

Post a Comment