Q. Write a C program to verify that entered word is character, number or symbol.
Ans.
/*c program for identify entered word is character, number or symbol*/
#include<stdio.h>#include<conio.h>
int main()
{
char ch;
printf("Enter Any word : ");
scanf("%ch", &ch);
if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
printf("You entered Alphabet!!");
else if(ch>='0' && ch<='9')
printf("You entered Number!!");
else
printf("You entered Symbol!!");getch();
return 0;
}
/********************Output*****************/
Screen shot for what is entered by user C program |
Related programs:
write a program that inputs marks of ten students and prints the list of marks that are above average
ReplyDelete