Can someone tell me what is wrong with this code?

/ reading in characters using getchar and printing with putchar /

int main()


char ch1, ch2, ch3;

printf(“Enter three characters\n”);

ch1 = getchar();

ch2 = getchar();

ch3 = getchar();

printf("\nYou entered:");




printf("\n\nwhich have ascii codes: %d %d %d\n", ch1, ch2, ch3);


I am supposed to debug this and find out what is wrong, that is all I was told

You will need to tell us what you expect it to do vs. what happens when you run it currently.

1 Like