sahajjain01

Display pattern #6

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