To find a character is no./letter/special character
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("Enter a charatcer : ");
scanf("%c", &ch);
if (ch >= 65 && ch <= 90)
printf("\nEntered character is a uppercase letter") ;
else if(ch >= 97 && ch <= 122)
printf("\nEntered character is a lowercase letter");
else if(ch >= 48 && ch <= 57)
printf("\nEntered character is a number");
else
printf("\nEntered character is a special character");
getch();
}
Output:
Case: 1
Enter a charatcer : b
Entered character is a lowercase letter
Case: 2
Enter a charatcer : V
Entered character is a uppercase letter
Case: 3
Enter a charatcer : 2
Entered character is a number
Case: 4
Enter a charatcer : #
Entered character is a special character
-
UpdatedDec 31, 2019
-
Views4,630
You May Like
Program to maintain employee details using structures
Program to maintain student details using structures
Check whether the person is eligible to vote or not
Print the numbers that are divisible by a given no.
Program to generate magic square
To sort the given numbers in ascending & descending order