Check entered character is alphabet, digit or punctuation symbol

Write a C program to accept a character from user and check if it is an alphabet, digit or punctuation. If it is an alphabet then check whether it is uppercase or lowercase.

Solution:

#include<stdio.h>
int main()
{
    char ch;
    printf("Enter Character : ");
    scanf("\n %c",&ch);
    /* Condition to check character is alphabet*/
    if((ch>=65 && ch<=90 )|| (ch>=97 && ch<=122))
    {
        printf("\nIt is an Alphabet.");
        /* If character is alphabet then check it is uppercase or lowercase*/
        if(ch>=65 && ch<=90)
        {
            printf("\n\n'%c'is Uppercase Character.",ch);
        }
        else
        {
            printf("\n\n'%c'is Lowercase Character.",ch);
        }
    }
    /* Condition to check character is digit*/
    if(ch>=48 && ch<=57)
    {
        printf("\n'%c' is Digit.",ch);
    }
    /* Condition to check character is special character or punctuation symbol*/
    if((ch>=58 && ch<=64) || (ch>=91 && ch<=96) || (ch>=33 && ch<=47) || (ch>=123 && ch<=126))
    {
        printf("\n'%c' is Punctuation Symbol.",ch);
    }
    return 0;
}


Output:

alphabet digit punctuation

alphabet digit punctuation

alphabet digit punctuation

alphabet digit punctuation