Problem Link - Is it a VOWEL or CONSONANT Practice Problem in 500 to 1000 difficulty problems
Problem Statement:
Write a program to take a character C as input and check whether the given character is a vowel or a consonant.
Approach:
Use multiple if conditions to compare the input character C with each vowel (‘A’, ‘E’, ‘I’, ‘O’, ‘U’).
Complexity:
- Time Complexity: Comparison takes
O(1)using if. - Space Complexity:
O(1)No extra space used.