sahajjain01

Display pattern #5

Aug 21st, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. /* Program to display the following pattern:
  2.     1
  3.    222
  4.   33333
  5.  4444444
  6. 555555555
  7. */
  8. #include<iostream.h>
  9. #include<conio.h>
  10. void main()
  11. {
  12.     clrscr();
  13.     for(int i=1,l=4,m=1;i<=9;i+=2,l--,m++)
  14.     {
  15.         for(int j=1;j<=l;j++)
  16.         cout<<" ";
  17.         for(int k=1;k<=i;k++)
  18.         cout<<m;
  19.         cout<<endl;
  20.     }
  21.     getch();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment