You are viewing a single comment's thread. Return to all comments →
void main( ) { int n; printf("Give input"); scanf("%i",&n); for(int i=1; i <= 2*n-1;i++) { int k=1; for(int j=1;j <= 2*n-1; j++) { for(int m=1;mi) k --; if(j>=2*n-i+1) k --; break; } printf("%i ",n-k+1); } 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
void main( ) { int n; printf("Give input"); scanf("%i",&n); for(int i=1; i <= 2*n-1;i++) { int k=1; for(int j=1;j <= 2*n-1; j++) { for(int m=1;mi) k --; if(j>=2*n-i+1) k --; break; } printf("%i ",n-k+1); } printf("\n"); } }