Program to display the category of the Character

//Program to display the category of the Character
#include<stdio.h>
#include<conio.h>
int main()
{
char c;
clrscr();
printf("Enter the character\n");
scanf("%c",&c);
if(c>=65&&c<=90)
printf("The character is UPPERCASE alphabet");
else if(c>=97&&c<=122)
printf("The character is lowercase alphabet");
else if(c>=48&&c<=57)
printf("The character is Digit");
else if(c==32)
printf("The character is Space");
else if(c==9)
printf("The character is Tab");
else if(c==13)
printf("The character is Carriage Return");
else if(c==10)
printf("The character is New Line");
else
printf("The character is a special character");
getch();
return 0;
}

To Run this Program Copy it in text editor and save as .c
Then double click on it and then it will get opened in your compiler.
Click on run.

No comments:

Post a Comment