A very simple program to print right triangle shape in C++.
PROGRAM:
#include<iostream>
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;
}
OUTPUT:
0 0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5