1
Instead of the code reading the three char variables, it reads 2 and prints the first.
#include <stdio.h>
int main() {
char ch1, ch2, ch3;
puts("Digite 3 caracteres, um apos o outro:");
scanf("%c%c%c", &ch1, &ch2, &ch3);
printf("%c\n%c\n%c", ch1, ch2, ch3);
return 0;
}
I just tested your program and it’s working. It’s reading the 3 typed letters and showing on the screen.
– electus
I can confirm the @Electus comment. I ran the program and the
output
is what is expected.– Omni
This is very strange, because now it reads 2 characters and closes, I used this online compiler to test but still the program does not behave properly.
– Wellington Viana
I added an answer. Take a look.
– electus