Created
March 3, 2018 06:33
-
-
Save varshneydevansh/b8a98948a67c83a8168428304694db46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
string S; | |
cin>>S; | |
int L=S.size(); //Calculating and storing the size of S | |
int cnt = 0; //This will contain the number of vowels in S | |
for(int i=0; i<L; i++){ | |
/*If we find the character at ith index to be a vowel increase cnt by 1!*/ | |
if(S[i]=='A' || S[i]=='E' || S[i]=='I' || S[i]=='O' || S[i]=='U')cnt++; | |
} | |
cout<<cnt<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment