-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswitch-case186-.cpp
41 lines (39 loc) · 956 Bytes
/
switch-case186-.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
Task-> A simple program that uses Switch-Case for finding Vowel/Consonant..
1. Start
2. Function check for && writing switch case statement.
3. Is charInput == case(charInput):
1.True-> cout << "Vowel";
2.False->default:
->cout <<"consonant"
4. Exit.
*/
// Function that takes somsething return nothing.
#include <iostream>
using namespace std;
void check(char charInput){
char choice;
cin >> choice;
switch (choice) {
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
cout << charInput <<" is a vowel";
break;
default:
cout << charInput << " is a consonant";
}
}
int main()
{
char choice;
cout << " Enter an Character To check vowel || consonant ";
check(choice);
}