Thursday, December 19, 2013
Home »
Program Print Number Triangle Reverse 5 To 1
» Program Print Number Triangle Reverse 5 To 1
Program Print Number Triangle Reverse 5 To 1
/*
Write a C++ Program to display the following
Number Triangle output by nested for loop.
54321
5432
543
54
5
For Free C++ Programming Techniques (Example Programs), visit
Www.EasyCppProgramming.Blogspot.Com
and For Good Notes
Visit Www.ForFreeEducation.Blogspot.Com
*/
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int counter1, counter2;
cout<<"\n\n ----------- Results ------------\n";
for ( counter1 =1; counter1<=5; counter1++)
{
for(counter2=5; counter2>=counter1; counter2--)
cout<<counter2;
cout<<endl;
}
getch();
}
0 comments:
Post a Comment
We Love To Hear From You!