@VishalChoudhary/

vowel calculator first cpp program

C++11

my first cpp program, just getting my feet wet, thats all;

fork
loading
Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
int main(){
	char name[100];
	char plural[] = "aeiou";
	int total = 0;
	
	cout<< "enter yout name here : ";
	cin >> name;
	
	for(int i=0; i<sizeof(name)/sizeof(name[0]); i++){
		 for (int j=0; j< 5;j++){
		 	if(name[i]==plural[j]){
		 		total++;
			 }
		 }
	}
	
	cout << "your name contains "<<total<<" vowels!!!";
	
}