sahajjain01

18.Display pattern #02

Aug 16th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. /* Program to display the following pattern:
  2. 1
  3. 12
  4. 123
  5. 1234
  6. 12345
  7. */
  8. #include<stdio.h>
  9. #include<conio.h>
  10.  
  11. void main()
  12. {
  13.     int i, j;
  14.  
  15.     clrscr();
  16.  
  17.     for(i = 0; i<4; i++) {
  18.         for(j = 0; j <= i; j++)
  19.             printf("%d", j + 1);
  20.         printf("\n");
  21.     }
  22.  
  23.     getch();
  24. }
Advertisement
Add Comment
Please, Sign In to add comment