You are viewing a single comment's thread. Return to all comments →
int main() { int n,a; scanf("%d",&n); a=n;
for(int i=1;i<=2*n-1;i++) { for(int j=1;j<=2*n-1;j++) { if(j<n-abs(n-i)){printf("%d ",a);a--;} else if(j>n+abs(n-i)){a++;printf("%d ",a);} else printf("%d ",a); } 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 →
include
include
int main() { int n,a; scanf("%d",&n); a=n;
}