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
The process of identifying and eliminating bugs in a software program is most generally called
12345 [234]

Answer:

Debugging is the correct answer to the given question.

Explanation:

Debugging is the process detect and eliminate the bugs in the software application .The debugging is the play important role in any  software application because if we do not remove the bugs or errors in the software application we do not get error free software application .

The debugging is comes under the category of the system development life cycle .The main objective of debugging to prohibit the programmer or the device from operating inappropriately.The programmer is checking the source code of the program find the bugs and correct it .

7 0
3 years ago
I wiil mark brainlist ​
Darina [25.2K]
CAD is the answer you require, but it may also be Spread sheet

Hope this helped ♥︎
5 0
3 years ago
What term refers to mathematical equations used in Excel to perform calculations?
vovikov84 [41]

Formulas is the BEST answer to your question.

4 0
3 years ago
Direct messaging is similar to email, except
fredd [130]
No personal web..............
6 0
3 years ago
Read 2 more answers
A car with a 20-gallon gas tank averages 23.5 miles per gallon when driven in town and 28.9 miles per gallon when driven on the
katovenus [111]
Highway: 
<span>cout << "The car can drive " << 20*26.8 << " miles on the highway." << endl; </span>
<span>Town: </span>
<span>cout << "The car can drive " << 20*21.5 << " miles in the town." << endl;</span>
5 0
3 years ago
Other questions:
  • Device that converts sound into electrical signals, which are sent to the computer or other recording device
    6·1 answer
  • List and explain the error in the code
    14·1 answer
  • How would you display all your photographic work in your résumé, if you have a large volume of work?
    10·1 answer
  • What are the differences in LAN and WAN and how they are used to Increase Cybersecurity
    7·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • What is the biggest challenge for most business when going online?
    12·1 answer
  • Siapa mahapatih brainly.com atau yg disebut Brainly Amerika Serikat ?​
    5·1 answer
  • What is it called when you remove some information from a file or remove a file from the disk ? A) save b) delete c) edit d) rem
    5·1 answer
  • Which term is used in object-oriented programming to reference characteristics of an object?
    15·1 answer
  • Which of the following is NOT a function of a Web Browser?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!