c program to print vowels or consonants using if else

Solutions on MaxInterview for c program to print vowels or consonants using if else by the best coders in the world

showing results for - "c program to print vowels or consonants using if else"
Auguste
19 Jan 2020
1#include <stdio.h>
2int main() 
3{
4char c;
5int small, big;
6printf("Enter the letter");
7scanf("%c", &c);
8small = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
9big = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
10if (small || big)
11printf("%c is a vowel", c);
12else
13printf("%c is a consonant", c);
14return 0;
15}