In the above question, I believe that I have coded correctly as in my compiler it is showing the desired result but the answer is not being submitted. It shows " wrong answer". Please check and verify-
#include
using namespace std;
int main() {
int i,j,N,k;
cout<<"Enter the no. of rows: " << endl;
cin>> N;
for(i=1;i<=N;i++)
{
for(j=1;j<=i;j++)
{
cout<< j;
}
for(k=N;k>=j;k--)
{
cout<< "*";
}
cout<< " " << endl;
}
return 0;
}