Friday, 29 March 2013

Any character is entered through the keyboard; write a program to determine whether the character entered is a capital letter , a small case letter , digit or a special character. If You Use More Than 4 If-else Stetements And More Than One && Operator In If Condition,Your Number Will be Marked Zero.


#include<stdio.h>
void main()
{
char a;
printf("enter character,digit or a symbol=");
scanf("%c", &a);
if(a>=65 && a<=90)
{
printf("a capital case letter");
}
else if (a>=97 && a<=122)
{
printf("a small case letter");
}
else if(a>=48 && a<=57)
{
printf("digit ");
}
else if(a<=47 || a>=58 || a<=64 || a>=91 || a<=96 || a>=123 || a<=127)
{
printf("special symbol");
}
else
{
printf("wrong character");
}
printf("\n");
}



No comments:

Post a Comment