Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Wednesday, January 06, 2016

Count Number of Vowel in a String.

Count Number of Vowel in a String.


Structure of the Problem Requirements

The Program will count the numbers of vowels in a given string. There could be many solutions of this program but we used the most easy and efficient method.

Source Code  

#include<iostream> 
#include<stdio.h> 
using namespace std;
int main() 
{ 
char story [80];
int vowel = 0;
cout<<" \t \t \t Enter Your Story Below \n \n ";
gets(story);
for(int i=0;story[i]!='\0';i++)
{
 if ((story[i] == 'a') ||(story[i] == 'e') ||(story[i]=='i')|| (story[i]=='o') ||(story[i]=='u'))
 {
  vowel++;
}
}
cout<<endl;
cout<<" Your Story Contain "<<vowel<<" Vowels"; 
}

Output of the Program

Count Number of Vowel in a String.
Share:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List