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 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.
See Also: Java Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol
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
Similar to Check Uppercase or Lowercase Character
- C Program to Delete a Substring From a String
- C Program to Convert Lowercase to Uppercase And Vice Versa
- Write a Program to Reverse a String in C
- String Palindrome Program in C With Explanation
- Find the Number of Vowels, Consonants, Digits and White Space Character
- C++ Program To Check Character Is Uppercase, Lowercase Alphabet Or A Digit Or A Special Symbol
0 Comments: