#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
printf("Enter the character: ");
scanf("%c",&ch);
if(ch>='a' && ch<='z')
printf("\n'%c' is a Lower Case Character.",ch);
else if(ch>='A' && ch<='Z')
printf("\n'%c' is an Upper Case Character.",ch);
else if(ch>='0' && ch<='9')
printf("\n'%c' is a Digit.",ch);
else
printf("\n'%c' is a Special Character.",ch);
getch();
}
Output:
Please have a look at the below lesson posted on my YouTube channel:
#include<conio.h>
void main()
{
char ch;
printf("Enter the character: ");
scanf("%c",&ch);
if(ch>='a' && ch<='z')
printf("\n'%c' is a Lower Case Character.",ch);
else if(ch>='A' && ch<='Z')
printf("\n'%c' is an Upper Case Character.",ch);
else if(ch>='0' && ch<='9')
printf("\n'%c' is a Digit.",ch);
else
printf("\n'%c' is a Special Character.",ch);
getch();
}
Output:
No comments:
Post a Comment