C Program to Check Whether a Character is an Alphabet or not - Source Code, Output & Execution Flow

C Program to Check Whether a Character is an Alphabet or not

This tutorial explains c program to check whether a character is an alphabet or not with C source code, sample output, and step-by-step execution flow.

#include <stdio.h>
int main() {
    char ch;
    printf("Enter a character: ");
    scanf(" %c", &ch);
    if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) printf("%c is an alphabet.
", ch);
    else printf("%c is not an alphabet.
", ch);
    return 0;
}
Enter a character: G
G is an alphabet.

In this program, the input is read first when required, the core logic is applied step by step, and the final result is displayed using printf(). Follow the execution flow beside the code to understand how each statement contributes to the output.