CodePudding user response:
Ch it without 'Repeat the logic judgment, code changes as follows, for reference:
# include & lt; Stdio. H>
Int main (int arg c, char * argv [])
{
char ch;
Printf (" input a letter ");
Ch=getchar ();
If (' a '& lt;=ch & amp; & Ch & lt;='z')
{
Ch=ch - 32;
Printf (" \ n % c, % d ", ch, ch);
}
The else
If (' A '& lt;=ch & amp; & Ch & lt;='Z')
{
Ch=ch + 32;
Printf (" \ n % c, % d ", ch, ch);
}
The else
Printf (" % c \ n ", ch);
return 0;
}