Check if character is digit or alphabet - C

Write a C program to check whether the entered character is digit or an alphabet.

Solution:

#include <stdio.h>
int main()
{
    char ch;
    /* Reads a character from user */
    printf("Enter any character: ");
    scanf("%c", &ch);
    /* Checks if it is an alphabet */
    if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
    {
        printf("%c is ALPHABET.\n", ch);
    }
    if(ch >= '0' && ch <= '9')
    {
        printf("%c is DIGIT.\n", ch);
    }
    return 0;
}


Output:

check digit or alphabet