Computer Science, asked by Divyanshb01, 1 year ago

write a program in c to check whether a character is alphabet or not?

Answers

Answered by siddhartharao77
3
void main()
{
char alphabet;
printf("Enter a character");
scanf("%c",&alphabet);

if(alphabet >= 'a' && alphabet <= 'z') || (alphabet >= 'A' && alphabet <= 'Z')
{
printf("%c is an Alphabet");
}
else
{
printf("%c is not an Alphabet");
}
getch();
}
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{

       printf("it is not alphabet");

   }

   

   return 0;

}

output:-

enter the character A

it is alphabet

Similar questions