C Program to Check Alphabet or Not

#include<stdio.h>
#include<conio.h>
void main()
{
    clrscr();
    char ch;
    printf("\n Enter a character: ");
    scanf("%c",&ch);
    if((ch>='a'&& ch<='z') || (ch>='A' && ch<='Z'))
    {
        printf("\n%c is an alphabet",ch);
    }
    else
    {
        printf("\n %c is not an alphabet",ch);
    }
    getch();
}

Run 1:




Run 2:

No comments:

Post a Comment

100 C Programs with Code and Output

Program 1: C Program To Read Two Numbers And Print The Sum Of Given Two Numbers. Program 2: C Program To Read Three Numbers And Prin...