Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

C program to check a Character Is An Alphabet Or Not

Character is alphabet or not:

The C program checks whether the character entered is an alphabet or not. The program makes use of character value inserted by the user. This value can range between lowercase or uppercase alphabets, such as ‘a’ and <= ‘z’ and ‘A’ and <= ’Z’. If the character inserted by the user lies between the above category or ranges then the character is an alphabet and if it does not lie within the given range then it is not.

C program to check a character is an alphabet or not

Implementation:-

Step 1: Start.

Step 2: Insert a character (by the user).

Step 3: Check whether the character lies between a to z and A to Z, if true, print “Alphabet”.

Step 4: condition is false print” not an alphabet”.

Step 6: Stop

C Code:-

//C Program to find character is alphabet or not
#include<stdio.h>
#include<conio.h>
int main()
{
   char a;

      //Requesting user to insert the character
  printf("Insert any character: ");

     //keeping the inserted character into the variable a
   scanf("%c",&a);
 
  if( (ch>='a' && ch<='z') || (ch>='A' && ch<=Z'))
     printf("The inserted character %c is an Alphabet”, a);
   
  else
    printf("The entered character %c is not an Alphabet”, a);
  return 0;
}
Output:-
Insert any character:  P
The insertd character P is an alphabet.
Insert any character: 9
The entered character 9 is not an alphabet.