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 ____ cell on the worksheet is the one into which you can enter data.â
Illusion [34]

I guess the best answer is Active.

The Active cell on the worksheet is the one into which you can enter data.

3 0
3 years ago
Read 2 more answers
Which tool do you think would be the most useful if you were designing a logo for a business?
Maurinko [17]

Answer:

maybe a computer would be helpful

6 0
3 years ago
Read 2 more answers
Explain different types of secondary memory of computer system<br>​
Westkost [7]

<em>Answer:</em>

<em>There are three main types of secondary storage in a computer system: solid state storage devices, such as USB memory sticks. optical storage devices, such as CD, DVD and Blu-ray discs. magnetic storage devices, such as hard disk drives.</em>

<em>Explanation:</em>

6 0
2 years ago
What is NOT type of network?
Serjik [45]

Answer:

hope this helps good luck

need more answers follow me

Explanation:

Answer = c. Explanation:The Types of Computer Networks are LAN, MAN, PAN, WAN, CAN but RAN Remote Area Network is not a type of CN

3 0
3 years ago
What is the output for the following program? numB = 2 while numB &lt; 15: numB = numB + 5 print(numB) Output:
slamgirl [31]

Explanation:

7

12

17

that's the answer

4 0
3 years ago
Other questions:
  • Tim is trying to explain to his aunt how her computer works, but she does not understand what a CPU does. Which description will
    6·2 answers
  • Tara and Zach are leading a systems development project and they want the investigation phase to go smoothly and quickly. They d
    5·1 answer
  • What is the unemployment rate if the GDP gap is 13.5%?<br><br> A. 6.25%<br> B. 6.75%<br> C. 6.7%
    8·1 answer
  • Why did my typing suddenly become delayed, but then went back to normal a few minutes later. Is this spyware or smth?
    6·1 answer
  • How to do row of circles in phyton programming ?
    11·1 answer
  • Can someone help me?
    14·1 answer
  • Red + blue =<br>Red + green =<br>Magenta - blue =<br>Yellow - green =<br>Cyan - blue =​
    9·1 answer
  • Firestick optimizing system storage and applications
    14·1 answer
  • How many 60 KB jpeg files can be stored on a 2 MB folder in your hard drive?​
    7·1 answer
  • Posts that you delete
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!