Vowels Counter


#include "stdafx.h"  // Header file for MS VS
#include <iostream>  // Some compiler used < iostream.h>
#include <conio.h>  // header file

using namespace std ;
int main()
{
char input[100] ;
int vowels = 0 , i = 0 ;
cout << "Enter A String : " ;
cin.getline(input , 100 , '\n') ;
while (input[i] != NULL)
{
switch (input[i])
{
case 'a': case 'A' :
case 'E': case 'e' :
case 'i' : case 'I' :
case 'o' : case 'O' :
case 'u' : case 'U' :
vowels ++ ;
default :
break ;
}
i++ ;
}
cout << "Vowels in your enterd string : " <<vowels ;
_getch() ; // Some compilers use getch()
return 0 ;

}

Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment