1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Bess [88]
3 years ago
13

Write a function that counts and returns the number of vowels in the input, up to the next newline or until the input is done, w

hichever comes first. Your function should have the following prototype:
int count_vowels();
Computers and Technology
1 answer:
Valentin [98]3 years ago
3 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// function that return the number of vowels in the input string

int count_vowels()

{

// variable

   string str;

   int v_count=0;

   cout<<"enter the string:";

   // read the string

   cin>>str;

   // fuind the length

   int len=str.length();

   // check for vowel

   for(int x=0;x<len;x++)

   {

       char ch=str[x];

       if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'|ch=='U')

       {

           v_count++;

       }

   }

   // return the count

   return v_count;

}

// driver function

int main() {

// call the function and print the result

cout<<"number of vowels in string is : "<< count_vowels()<<endl;

return 0;

}

Explanation:

In the function count_vowels(), read a sting and then find its length.Then check each character of the string is vowel or not.If it is vowel then Increment the v_count. After the loop return the count to main function and print it.

Output:

enter the string: welcometoprogramming

number of vowels in string is : 7

You might be interested in
Landing pages in a foreign language should never be rated fully meets?
PilotLPTM [1.2K]

Answer:

if the landing page provides all kind information of information as to that site people usually like it or will most likely enjoy it

BRAINLIEST?????

Explanation:

3 0
2 years ago
In which way is a worm different from a virius
dangina [55]
A worm as a multicell organism, but a virus is a single cell.
3 0
3 years ago
When should you integrate technology?​
earnstyle [38]
Nolur acil lütfen yalvarırım yalvarırım lütfen yalvarırım when should you integrate technology?
5 0
3 years ago
Read 2 more answers
How fast will a viral meme spread if it is not contained within 24 hours?
sveta [45]
Well a viral meme would spread very fast, it's a VIRAL meme which means it would spread faster than a normal meme. Even if it is contained in the 24 hour time period it would still become rather popular.
6 0
3 years ago
Read 2 more answers
Which of the following statements is true about DVI connectors? *
Elis [28]

Answer:

I think u had forgot to mention the statements.

4 0
3 years ago
Other questions:
  • 32.
    11·1 answer
  • An indirect effect of an action, be it a cost or benefit, for a third party who did not agree to the action is known as a(n) ___
    8·1 answer
  • Which is a characteristic of an effective problem statement? It is based on research. It contains outside information. It contai
    12·1 answer
  • g Define memory hierarchy. A. The rate at which information can be transferred from one place to another. B. Ordering storage sy
    8·1 answer
  • 2. Integer plot function (find a smart way to code big integers) Write a program BigInt(n) that displays an arbitrary positive i
    8·1 answer
  • In the Mouse Properties window, you can?
    8·1 answer
  • The data-linking feature that allows Internet users to skip directly from a highlighted word to a related file in another comput
    12·2 answers
  • The force required to slide an object is equal to _____.
    13·1 answer
  • Write a police description a person who know you well​
    12·1 answer
  • You are the Emergency Management Director of a small island nation. Your nation has come under Cyber-attack and the attackers ha
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!