Input Character and Check if it's Upper-Lower Case or a Digit C Program

How to write a c program to input a character and check if it's upper case, lower case or a digit in C Programming Language ?



Solution:
//Program to input a character and check if it's upper case, lower case or a digit.
#include<stdio.h>
#include<conio.h>
#include<ctype.h>

void main()
{
char ch;

clrscr();

printf("Enter a character: ");
scanf("%c", &ch);

if(isupper(ch))
printf("The character %c is upper case.", ch);
else if(isdigit(ch))
printf("The character %c is a digit.", ch);
else if(islower(ch))
printf("The character %c is lower case.", ch);

getch();
}


Learn More :