C Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit or A Special Symbol Using If/Else Statements

#include <stdio.h>
int main()
{
    char ch;
    /* Input character from user */
    printf("Enter any character: ");
    scanf("%c", &ch);
    if(ch >= 'A' && ch <= 'Z')
    {
        printf("'%c' is uppercase alphabet.", ch);
    }
    else if(ch >= 'a' && ch <= 'z')
    {
        printf("'%c' is lowercase alphabet.", ch);
    }
    else
    {
        printf("'%c' is not an alphabet.", ch);
    }
    return 0;
}

Output:


		

Leave a Comment