There are 2 main problems in your code.
The first is that you are using a
instead of 'a'
. When the compiler sees a
it attempts to interpret it as an identifier. This means it should refer to an argument, local, function name, etc ... The intent of your code though is for it to mean the character a (first letter of the alphabet). Putting the single quotes around a single letter causes the compiler to interpret it as a character literal.
The second issue is that your conditional statement is incorrect. You are trying to see if C
is both greater than or equal to 'a'
and less than or equal to 'z'
. This type of boolean comparison is done with the &&
operator in C. It is only true if both the left hand side and right hand side of the &&
are also true
if ( C >= 'a' && c <= 'z')