Jan 31, 2007

C++ Program to print pyramid of numbers

C++ program to print pyramid of numbers.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

main()
{
clrscr();
int i,k;
for (i=1;i<=5;i++)
{
for (k=1;k<=i;k++)
{

cout<<i;
}
cout<<endl;
}
getch();
}

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive