sahajjain01

Display pattern #4

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