answersLogoWhite

0


Best Answer

You need to scan through the string and keep track of the vowelsoccurring. Here is a sample program:

#include

#include


int countVowels(char[] s){

int count = 0, i;

for( i=0; char[i] != '\0'; i++){

switch(char[i]){

case 'a':

case 'e':

case 'i':

case 'u':

case 'o': count++;break;

}

}

return count;

}


int main(){

char str[256];

printf("Enter the string:\t");

scanf("%s", str);

printf("The number of vowels in the string are :%d\n", countVowels(str));

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

clear

echo -n "Enter the Name / String:"

while :

do

read name

echo $name | awk '{print gsub(/[aeiou]/,"")}'

done

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to accept a string from keyboard and count and display the numbers of vowels present in the string by using function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

What does the NPV function do in Excel?

You use the NPV function. Start by specifying the rate and follow it with a list of future values that you want to help determine your result. So you could have something like this:=NPV(5%,10,20)


To present or hold up to view?

display


What is to present or hold up to view?

display


What are to different meanings for project?

To display or to present


What is the present tense of the word displayed?

I/you/we/they display. He/she/it displays. The present participle is displaying.


If you want to find the present value of an investment you should choose the financial function?

You can use the PV function or the NPV function. Present Value is the result of discounting future amounts to the present. Net Present Value is the present value of the cash inflows minus the present value of the cash outflows.


When oxygen is not present what does not function?

electron transport chain does not function


Where is the times button on the Mac keyboard?

On a keyboard the times button has the symbol "*" printed on it, this is usually found as upper case "8" but there may also be a "*" present on the numeric keypad section of your keyboard, if your keyboard has this.


What is the Function of education in present context?

what are the functions of education in the present day context


What are the Difference between display and list commands?

display command help to display the single current record in a database where as list command helps to display all the current record which are present in a data base.


What is the function of simple present tense?

The function of simple present tense is used to ; - describe about what people do in the present time. - it is also used to express something based on the reality


Where is a divison sign on a keyboard?

On a keyboard, the division sign often used in schools ( ÷ ) is not typically present, instead the solidus or 'forward slash' ( / ) should be used.