Pattern with zeros

i am unable to form the code for this problem.pls tell

hi @yutikakhanna
share your code

#include using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=i;j++){ if((j==1)||(j==i)){ cout<<i; } else{ cout<<“0”; } } cout<<endl; } return 0; }

Hi
Save your code to online ide of coding block and share link here

hi @yutikakhanna
check this


i have marked the error
and
also proper intend your it help you to debugging