Determine a Character Type C Program

How to write a c program to determine a character type in c programming?

https://en.wikipedia.org/wiki/C_character_classification

Solution:
#include <stdio.h>

int main()
{
char ch;

scanf("%c", &ch);

if(ch >= 'a' && ch <= 'z')
                printf("Small letter\n");
        else if(ch >= 'A' && ch <= 'Z')
                printf("Capital letter\n");
        else if(ch >= '0' && ch <= '9')
                printf("Digit\n");
        else
                printf("Punctuation");

return 0;
}


Learn More :