Quick actions

cmd+k|ctrl+k

Navigation

Languages

Check a character is vowel or consonant

Snippet info

Language

C

Visibility

public

Author

mohiuddintamim999

Created

2020-10-12T18:07:45Z

Updated

2020-10-12T18:13:29Z

#include<stdio.h>

int main(void){
    char ch;
    scanf("%c", &ch);
    if(ch == 'A'|| ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' || ch == 'a'|| ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u'){
        printf("Vowel");
    }else{
        int ch_ascii;
        ch_ascii = ch;
        switch (ch_ascii){
            case 65 ... 90:
                printf("Consonant");
                break;
            case 97 ... 122:
                printf("Consonant");
                break;
            default:
                printf("Anything else");
        }
    }
    
}
INFO