You are viewing a single comment's thread. Return to all comments →
int main() { int n; int absRow, absColumn; scanf("%d", &n); for(int row = n; row >= -n; row--) { if(row == 0 || row == -1) { continue; } for(int column = n; column >= -n; column--) { if(column == 0 || column == -1) { continue; } absRow = abs(row); absColumn = abs(column); if(absColumn <= absRow) { printf("%d ", absRow); } else { printf("%d ", absColumn); } } printf("\n"); } return 0; }
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 →