Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Program to display the following pattern:
- *
- ***
- *****
- *******
- *********
- */
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- for(int i=1,l=4;i<=9;i+=2,l--)
- {
- for(int j=1;j<=l;j++)
- cout<<" ";
- for(int k=1;k<=i;k++)
- cout<<"*";
- cout<<endl;
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment