4.02.2012

Identify what is entered

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:
  1. Identify case of character C program
  2. How to change case of character C program
  3. Read and print string C program

1 comment:

  1. write a program that inputs marks of ten students and prints the list of marks that are above average

    ReplyDelete