/*WAP to check enter character is Alphabat,digits or any special char.*/
#include<stdio.h> #include<conio.h> void main() { char any; clrscr(); printf("enter any character"); scanf("%c", &any); if(any>=48&&any<=57) { printf("it is digit"); } else if(any>=97&&any<=122) { printf("it is lowercase alphabat"); } else if(any>=65&&any<=90) { printf("it is upper case alphabat"); } else if(any>=32&&any<=47) { printf("it is special symbol"); } else if(any>=58&&any<=64) { printf("it is special symbol"); } else if(any>=91&&any<=96) { printf("it is special symbol"); } else if(any>=123&&any<=127) { printf("it is special symbol"); } getch(); }
No comments:
Post a Comment