Saturday, 28 November 2015

Write a Cprogram to print 1,22,333,4444,55555 pattern


1:  //1  
2:  //2 2  
3:  //3 3 3  
4:  //4 4 4 4  
5:  //5 5 5 5 5  
6:  #include<stdio.h>  
7:  #include<conio.h>  
8:  void main()  
9:  {  
10:    int i,j,row;  
11:    clrscr();  
12:    printf("Enter the number of rows you want:\n");  
13:    scanf("%d",&row);  
14:    for(i=1;i<=row;i++)  
15:    {  
16:       for(j=1;j<=i;j++)  
17:       {  
18:         printf("%d ",i);  
19:       }  
20:       printf("\n");  
21:    }  
22:   getch();  
23:  }  

No comments:

Post a Comment