Answer to Question #47570 in C++ for krad

Question #47570
Write a program that determines if the input letter is a VOWEL or CONSONANT. The vowels are: A E I O U. Your program must be able to handle a capital or small input letter. In Switch Case
1
Expert's answer
2014-10-06T02:16:20-0400
#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
using namespace std;
int main()
{
char letter;

cout<<"Enter the letter"<<endl;
cin>>letter;

switch (letter)
{
case 'A':
case 'a':
case 'E':
case 'e':
case 'I':
case 'i':
case 'O':
case 'o':
case 'U':
case 'u':
cout<<letter<<" is a vowel"<<endl;
break;
default:
cout<<letter<<" is a consonant"<<endl;
break;
}
system("pause");
return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS