-1
How do I independent of the user typing the letter in lower or upper case read by scanf_s?
printf("\nVocê gostou do nosso produto?\n"
"\n[S] - Sim"
"\n[N] - Não\n\n"
"RESPOSTA:\t\n");
scanf_s(" %c", &p);
-1
How do I independent of the user typing the letter in lower or upper case read by scanf_s?
printf("\nVocê gostou do nosso produto?\n"
"\n[S] - Sim"
"\n[N] - Não\n\n"
"RESPOSTA:\t\n");
scanf_s(" %c", &p);
0
Use the function toupper
of <ctype.h>
.
After your scanf do:
p = toupper(p);
that p will be capitalized regardless of whether it has been typed in upper or lower case.
Browser other questions tagged c
You are not signed in. Login or sign up in order to post.
You want the entire input to be formatted to minuscule or uppercase ?
– Luiz Augusto
Every "letter" is read by scanf, either uppercase or lowercase. If you’re having trouble, it’s definitely not in the code you posted. It would be important to [Dit] and provide a [mcve] of the problem. Most likely your question is a XY problem.
– Bacco