I have write following C++ code for display a pyramid of natural numbers
#include <iostream>
using namespace std;
int main()
{
int i,j,n;
cout<<"Enter Size:";
cin>>n;
for(i=n;i>=1;i--)
{
for (j=i;j>0;j--)
{
cout<<j;
}
cout<<endl;
}
return 0;
}
but if we enter n=3 this code display
321
32
1
I want to display this as
123
12
1