Computer Science, asked by rishavshawant1821, 11 months ago

C program to check alphabet digit or special character

Answers

Answered by ritika2003
6

this program allows the user to enter One character.and then it will check whether the character is alphabet, digit or special character .

Answered by sougatap57
0

Answer:

#include <stdio.h>

int main()

{

  char ch;

  printf("enter the character");

  scanf("%c",&ch);

  if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))

  {

      printf("it is alphabet");

  }

  else if(ch>='0'&&ch<='9')

  {

      printf("it is digit");

  }

  else

  {

      printf("it is special character");

  }

   return 0;

}

Output:-

enter the character A

it is alphabet

Similar questions