Today i have been coding a came across with this code:
#include <stdio.h>
main() {
char letra1;
char letra2;
printf("Primera letra: ");
scanf("%c", &letra1);
printf("Segunda letra: ");
scanf("%c", &letra2);
}
When I execute the code the first scanf()
executes well but the second even didn't execute and close the program and I don't know why.
> ej3
Primera letra: A
Segunda letra:
Thanks for your time guys.