Write a C Program to Check Whether Character is Vowel or Not

In this tutorial learn how you can write a c program to check the entered character is vowel or not.

We are using a switch statement for this tutorial.

C programming is a powerful general-purpose programming language. It can be used to develop software like operating systems, databases, compilers, etc.


write c program to check whether character is vowel or not


Write a Program to Check Whether Character is Vowel or Not

Here is the code to check whether the entered character is a vowel or not in C programming.

#include <stdio.h> //WAP to check the entered character is vowel or not.
#include <ctype.h>
int main()
{
    char letter, test;
    printf("Enter any letter of your choices:");
    scanf("%c", &letter);
    test = toupper(letter);
    switch (test)
    {
    case 'A':
        printf("The character you entered %c is vowel letter.", letter);
        break;
    case 'E':
        printf("The character you entered %c is vowel letter.", letter);
        break;
    case 'I':
        printf("The character you entered %c is vowel letter.", letter);
        break;
    case 'O':
        printf("The character you entered %c is vowel letter.", letter);
        break;
    case 'U':
        printf("The character you entered %c is vowel letter.", letter);
        break;
    default:
        printf("The letter you entered %c isnot a vowel letter.", letter);
        break;
    }

    return 0;
}

Test Live At Jdoodle



Conclusion

This is how you can check whether the entered character is a vowel or not in c programming. Comment below if you like our tutorial.

0 Comments