You need to change this code so that the answer is displayed as a rhombus, not a square. I do not understand how this can be done.

#include <stdio.h> #include <windows.h> int main() { unsigned char n,k,symbol; for (n = 1; n<=5; n++) { symbol = 'I' - (n-2)*2; for (k = 1; k<=n-1; k++) { printf ("%2c", symbol); symbol = symbol + 2; } printf (" A"); symbol = 'C'; for (k = 1; k<=5-n; k++) { printf("%2c", symbol); symbol += 2; } printf("\n"); } system("pause"); return 0; } 

The final result should be as follows:

result

    1 answer 1

    Well, the dumbest way is - for example ,

     int main() { for(int row = 0; row < 7; ++row) { int d = abs(row - 3); char c = 'D' - d; int spaces = 2*d; for(int i = 0; i < spaces; ++i) printf(" "); for(char q = c; q >= 'A'; --q) printf("%c ",q); for(char q = 'B'; q <= c; ++q) printf("%c ",q); puts(""); } }