06/03/2023

C Program to Check Uppercase or Lowercase or Digit or Special Character

C Program to Check Uppercase or Lowercase or Digit or Special Character. We can say that write a program to check whether the given character is an uppercase letter or lowercase letter or a digit or a special character.. write a program to determine which character is entered by the user from the keyboard i.e., an uppercase character, a lowercase character, a digit or a special symbol. or write a c program to check whether the entered character is a capital, a small letter, a digit or any special character. 

Write a program to check whether the given character is a digit or a character in the lowercase or uppercase alphabet. (hint ASCII value of the digit is between 48 to 58 and lowercase characters have ASCII values in the range of 97 to122, and uppercase is between 65 and 90).

C Program to Check Uppercase or Lowercase or Digit or Special Character

C Program to Check Character Is Uppercase( Like A, B, C........Z), Lowercase ( Like a,b,c.....z ) Alphabet or A Digit ( Like 1,2,3,.......9 ) or A Special Symbol ( Like #,@,<,> ). To solve this problem we will use ASCII Value if you have any problem with ASCII Value You Can Check the C Program To Print the ASCII Value of the Character.

If the character is between 65 to 90 then You Entered UPPER CASE if it is 97 to 122 Then You Entered LOWER CASE if it is between 48 to 57 then it is a DIGIT and the remaining characters are SPECIAL SYMBOLS.

C Program to Check Uppercase or Lowercase or Digit or Special Character


#include <stdio.h>

void main()
	{
		/*write a c program to check whether the entered character is capital, small letter, digit or any special character.*/

		char a;
		printf("Enter Any Key to Check Whether the Given Character Is an Uppercase Letter or Lowercase Letter or a Digit or a Special Character.: ");
			scanf("%c", &a);

			if (a >= 65 && a < 90)
			{
				printf("\nCharacter is the Uppercase\n");
			}
			else
			{
				if (a >= 97 && a <= 122)
				{
					printf("\nCharacter is the Lowercase\n");
				}
				else
				{
					if (a >= 48 && a <= 57)
					{
						printf("\nCharacter is the  Digit\n");
					}
					else
					{
						printf("\nCharacter is the  Special Symbol\n\n");
					}
				}
			}
		}

See Also: Java Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol

The Output of C Program to Check Uppercase or Lowercase


c program to check the given character is lowercase or uppercase or special character.

Similar to Check Uppercase or Lowercase Character


Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: