Home
User Guide
DB Recovery
Download
Documents
FAQ
Books
About Me
C Programs
Stats

/* Program# 36
   date : 25-12-2008
   Classify upper,lower,Digit or special char
*/

#include <stdio.h>
main(){
char a;
printf("\nEnter a character :");
scanf("%c",&a);
if(a>=65 && a<=90)
printf("\n%c is uppercase letter\n",a);
else
if(a>=97 && a<=122)
printf("\n%c is Lowercase letter\n",a);
else
if(a>=48 && a<=57)
printf("\n%c is a Digit\n",a);
else
printf("\n%c is Special character\n",a);
}



output:
To compile the program, run the gcc command,
$ gcc p36.c  
Now the executable file is stored as a.out, to run
the program,

$ ./a.out

Enter a character :r

r is Lowercase letter

$ ./a.out

Enter a character :M

M is uppercase letter

$ ./a.out

Enter a character :^

^ is Special character

$ ./a.out

Enter a character :9

9 is a Digit
$ 






Powered by
Open Source Programmers