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