A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Write a program to find numbers of vowels in a line in c++

#include<iostream>
using namespace std;
int main()
{
   char l [10];
   int v=0,i;
   
    cout<<"enetr the line:\n:";
    gets(l);
    for(i=0;l[i]!='\0';++i)
    {
        switch(l[i])
        {
            case'a':
            case'A':
 
            case'e':
            case'E':
 
            case'i':
            case'I':
 
            case'o':
            case'O':
 
            case'u':
            case'U': ++v;
        }
    }
    cout<<"total vowels is"<<v<<endl;
}


Sample output:
















LEARN TUTORIALS

.

.