-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ15.c
28 lines (28 loc) · 839 Bytes
/
Q15.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* program:- 15.
Any character is entered through the keyboard, write a c program to determine
whether the character entered is a capital letter, a small case letter,
a digit or a special symbol.
*/
#include<stdarg.h>
void main()
{
char ch;
printf("Enter any character:- ");
scanf("%c",&ch);
if ( ch>=65 && ch<=90 )
{
printf("%c is a capital letter",ch);
}
else if ( ch>=97 && ch<=122 )
{
printf("%c is a small case letter",ch);
}
else if ( ch>=48 && ch<=57 )
{
printf("%c is a digit",ch);
}
else if ( (ch>=0 && ch<=47)||( ch>=58 && ch<=64)||(ch>=91 && ch<=96)||(ch>=123 && ch<=127) )
{
printf("%c is a special symbol",ch);
}
}