Sunday, 1 May 2016

C++ code to print right triangle shape using nested for loops

  • C++ Code:

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
   for(int i=0;i<=5;i++)

      {

        for(int j=0;j<=i;j++)
           

           {
                cout<<j;
            }
       cout<<endl;
    }
 return 0;
}




Share:

0 comments:

Post a Comment