#include <stdio.h> int main(void) { char f, a = '+', b = '+', c = '+', d = '+' ; int i; printf ("Please enter a character\n"); scanf (" %c", &f);/*Put a space before %c when in a for statement so that the for statement can be executed a second time, otherwise it would just take the empty space of the new line as the next character. By leaving a space you tell it to ignore the empty space left in the buffer and the next single character written. This problem is not applicable to integers as they don't read empty spaces as integers.*/ for (i=0; i<5; i++){ printf("%c%c%c%c%c%c%c%c%c\n",a,b,c,d,f,d,c,b,a); for (i=1; i<2; i++){ d = f; printf("%c%c%c%c%c%c%c%c%c\n",a,b,c,d,f,d,c,b,a); } for (i=2; i<3; i++) { c=f; printf("%c%c%c%c%c%c%c%c%c\n",a,b,c,d,f,d,c,b,a); } for (i=3; i<4; i++) { b=f; printf("%c%c%c%c%c%c%c%c%c\n",a,b,c,d,f,d,c,b,a); } for (i=4; i<5; i++){ a=f; } printf("%c%c%c%c%c%c%c%c%c\n",a,b,c,d,f,d,c,b,a); } return 0; }