in this code we have to make a pattern no of pyramid like
1
232
34543
but I wrote the code as this
#include
using namespace std;
int main()
{
int n;
int row=1;
cout<<“enter the no of rows”;
cin>>n;
for(;row<=n;)
{
int col=1;
int x=row;
for(;n-row>0;)
{
cout<<" ";
row=row+1;
}
for(;col<=row;)
{
cout<<x;
x=x+1;
col=col+1;
}
for(;x>1;)
{
x=x-1
cout<<x;
}
row=row+1;
cout<<endl;
}
return 0;
}
but why my output is not correct pls tell