C++ tutorial, C++ programs, C++ Exercises, C++ Example Programs

Showing posts with label Program Print Number Triangle Downside. Show all posts
Showing posts with label Program Print Number Triangle Downside. Show all posts

Thursday, December 19, 2013

Program Print Number Triangle Downside

C++ Program to print number triangle downside with nested loops
C++ Program to print number triangle downside with nested loops

Write a C++ Program to display the following
Number Triangle output by nested for loop.
12345
1234
123
12
1

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 =5; counter1>=1; counter1--)

     {
        for(counter2=1; counter2<=counter1; counter2++)
        cout<<counter2;

        cout<<endl;
     }  

  getch();

}
Share:

EasyCPPprogramming.blogspotcom

Labels