I have tried several times but didn’t get the logic
Please explain how to approach this problem
You can simply run two nested loops, from 1 upto n and then check
if(i==j || j==1) cout<<i;
else cout<<0;
I have tried several times but didn’t get the logic
You can simply run two nested loops, from 1 upto n and then check
if(i==j || j==1) cout<<i;
else cout<<0;