-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path181.cpp
More file actions
36 lines (27 loc) · 684 Bytes
/
181.cpp
File metadata and controls
36 lines (27 loc) · 684 Bytes
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
//Accept string from user and get Vowels
//Case Insensetive
#include<iostream>
using namespace std;
int CountVowel(char str[])
{
int iCnt = 0 ;
while(*str != '\0')
{
if((*str == 'a')||(*str == 'e')||(*str == 'i')||(*str == 'o')||(*str == 'u')||(*str == 'A')||(*str == 'E')||(*str == 'I')||(*str == 'O')||(*str == 'U'))
{
iCnt++;
}
str++;
}
return iCnt;
}
int main()
{
char Arr[20];
int iRet = 0;
cout<<"Enter string "<<endl;
cin.getline(Arr,20);
iRet = CountVowel(Arr);
cout<<"Number of Vowel are: "<<iRet<<endl;
return 0;
}