Number Pattern Code

This is the code I used to solve the problem of printing pattern in video 22, can you explain why it did not work (code in inverted commas)

1
123
12345
1234567

"#include

using namespace std;

int main()

{

int N;

cout<<"enter N ";

cin>>N;

int j;

for (int i=1;i<=N;i=i+1){

for(j=1;j<=N-i;j=j+1){
    cout<<' ';
}
for(int k=1;k=2*i-1;k=k+1){
    cout<<k;

}

cout<<endl;
}

return 0;
} "

hi @anikapassi17_6ce74879d4a8438b,
write k<=2*i-1 not =

oh right my bad, thanks

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.