#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
printf("Enter the character: ");
scanf("%c",&ch);
if(ch>=97 && ch<=122)
printf("\n'%c' is a Lower Case Character.",ch);
else if(ch>=65 && ch<=90)
printf("\n'%c' is an Upper Case Character.",ch);
else if(ch>=48 && ch<=57)
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>=97 && ch<=122)
printf("\n'%c' is a Lower Case Character.",ch);
else if(ch>=65 && ch<=90)
printf("\n'%c' is an Upper Case Character.",ch);
else if(ch>=48 && ch<=57)
printf("\n'%c' is a Digit.",ch);
else
printf("\n'%c' is a Special Character.",ch);
getch();
}
Output:
No comments:
Post a Comment