You are viewing a single comment's thread. Return to all comments →
int t=0,s=0;
for(int i=1; i<n*2; i++) { for(int j=0; j<n*2-1; j++){ t=i<=n?i:-i+n+n; if(t>j) s=n-j; else{ if(j<n-t+n) s=n-t+1; else s= j-n+2; } printf("%d ",s); } printf("\n"); }
Seems like cookies are disabled on this browser, please enable them to open this website
Printing Pattern Using Loops
You are viewing a single comment's thread. Return to all comments →
int t=0,s=0;