Tech Study

Write C program to check vowel or consonant using switch case

Introduction

Write C program to check vowel or consonant using switch case

#include <stdio.h>

int main()
{
    char ch;

    //Reading an alphabet from user
    printf("Enter any alphabet: ");
    scanf("%c", &ch);

    // checking vowel and consonant
    switch(ch)
    {
        case 'a': printf("vowel");
            break;
        case 'e': printf("vowel");
            break;
        case 'i': printf("vowel");
            break;
        case 'o': printf("vowel");
            break;
        case 'u': printf("vowel");
            break;
        case 'A': printf("vowel");
            break;
        case 'E': printf("vowel");
            break;
        case 'I': printf("vowel");
            break;
        case 'O': printf("vowel");
            break;
        case 'U': printf("vowel");
            break;
        default: printf("consonant");
    }

    return 0;
}

Result

Write C program to check vowel or consonant using switch case
Write C program to check vowel or consonant using switch case

TaggedWrite C program to check vowel or consonant using switch case

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more