Dremendo Tag Line

Check character is alphabet in C

if else - Question 11

In this question, we will see how to check if a character is an alphabet or not in C programming using the if else statement. To know more about if else statement click on the if else statement lesson.

Q11) Write a program in C to input a character and check if it is an alphabet or not. Make use of logical operators (&& ||) to solve this question.


#include <stdio.h>
#include <conio.h>

int main()
    char x;
    printf("Enter a character ");
    if((x>='A' && x<='Z') || (x>='a' && x<='z'))
        printf("Its an alphabet");
        printf("Its not an alphabet");
    return 0;


Enter a character G
Its an alphabet