Jan 31, 2007

C++ Program to print pyramid of numbers

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

main()

{

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

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

No comments:

Post a Comment

Infolinks In Text Ads

Total Pageviews

Powered by Blogger.

Dont Forget To Follow Us

Blog Archive