A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

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

Write C program to check vowel or consonant using switch case

0

Write C program to check vowel or consonant using switch case

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#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:

Enter any alphabet: a

vowel

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now