Program to determine the type of the character entered

A character is entered through the keyboard. Below is a program to determine whether the character entered is a capital letter, a small case letter, a digit or special symbol.
We will make use of isupper(), islower() and isdigit() functions to write this C Program.

isupper() – This function will take character as parameter and will return true if the character is UPPERCASE.
islower() – This function will take character as parameter and will return true if the character is lowercase.
isdigit() – This function will take character as parameter and will return true if the character is a digit else it will return false

Here is the program:

#include
#include

void main()
{
char ch;
clrscr();
printf("Enter a character = ");
scanf("%c", &ch);

if (isupper(ch))
{
printf("Character is in Upper case\n");
}
else
if (islower(ch))
{
printf("Character is in Lower case\n");
}
else
if (isdigit(ch))
{
printf("It is a digit\n");
}
else
{
printf("Special Symbol\n");
}
getch();
}

You may also like...

5 Responses

  1. My special to the maintainers of this website………………….vishwanathsharma Tadinada

  2. this site very helpful for c learners in online thank u sir,,,,……………………………….

  3. JAGRUT UBALE says:

    this sites is very nice and reliable to understand………….

  4. Kathryn says:

    You have touched some fastidious points here. Any way keep up
    writing.

  5. Shana says:

    Hello There. I found your blog using google. This is a
    really well written article. I’ll make sure to bookmark
    it and come back to read more of your useful info.
    Thanks for the post. I will certainly return.

Leave a Reply

Your email address will not be published. Required fields are marked *

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet