Logic
If the ASCII value of a character lies between 65 (A) to 90 (Z) then it is an uppercase character or if the character’s ASCII value lies between 97 (a) to 122 (z) then it is a lowercase character.
See also: Find ASCII value of a character
See the flow diagram:
Program
#include <stdio.h> int main() { char ch; printf("Enter any character : "); scanf("%c", &ch); if(ch >= 'A' && ch <= 'Z') { printf("\n%c is UPPERCASE alphabet.", ch); } else if(ch >= 'a' && ch <= 'z') { printf("\n%c is LOWERCASE alphabet.", ch); } else { printf("\n%c is not an alphabet.", ch); } return 0; }
Output
Enter any character : S
S is UPPERCASE alphabet.