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