In this tutorial you will learn about the C Program to Check Alphabet or Not and its application with practical example.
C Program to Check Alphabet or Not
In this tutorial, we will learn to create a C program that will Check Alphabet or Not using the C programming.
Prerequisites
Before starting with this tutorial we assume that you are best aware of the following C programming topics:
- Operators in C Programming.
- Basic Input and Output function in C Programming.
- Basic C programming.
- Conditional Statements in C programming.
- String concepts in C Programming.
Program to Check Vowel or Not
In c programming, it is possible to take character input from the user and Check Alphabet or Not with the help of a very small amount of code. The C language has many types of header libraries which has supported function in them with the help of these files the programming is easy. The string manipulation is very easy in C programming. In today’s program, we will take a character in input and Check Alphabet or Not.
With the help of this program, we can Check Alphabet or Not.
Algorithm:-
1 2 3 4 5 6 7 8 9 |
1. Declaring the variables for the program. 2. Taking the input a character from the user. 3. Pass that character to check with condition for alphabet. 4. Printing the output. 5. End Program. |
Program to Check Alphabet or Not:-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
/* C Program that will Check the given input is a alphabetor not */ #include <stdio.h> int main() { //Declaring the variable for the for the program char c; //Taking the input character from the user printf("Enter a character: "); scanf("%c", &c); // if input is a charcter //printing the output for alphabet else not a alphabet if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) printf("%c is an alphabet.", c); else printf("%c is not an alphabet.", c); return 0; } |
Output:-
In the above program, we have first initialized the required variable.
- c= it will hold the character value.
Input character from the user.
Program Logic Code.
Printing output Check Alphabet or Not.