Why I am not able to print space character?
c
Solution
You keep turning the space into something else with the line:
++space;
What did you expect that to do? Are you trying to make it a string of multiple spaces
You can left-pad your character by using a `printf` format specifier. Try this:
int width = 4;
char letter = 'A';
printf( ":%*c:\n", width, letter );
That would output 3 spaces and the letter A:
: A:
And if you simply want to put a space in, don't forget you can just put a space in the format string. As in the famous:
printf( "Hello, world!\n" );
Note there is a space in there.
Problem
This is my code: ``` int main(void) { int i, j, k, n; char userLatter, space; printf("please enter an uppercase letter:\n"); scanf("%c", &userLatter); n = 9; for (i = 0; i < 5; i++) { space = ' '; for (j = 5; j > i; j--) { ++space; } for (k = 0; k <= i ; k += 1) { printf("%c%c%c", space, userLatter, space); } printf("\n"); } } ``` Can you please tell me what I should do so I can print the space character? Thanks!