answersLogoWhite

0

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

12y ago

What else can I help you with?

Continue Learning about Engineering

When 25 numbers are entered from the keyboard into an array the number to be searched is entered through the keyboard by user write a program in C to find if number to be searched is present?

#include<stdio.h> #include<conio.h> void main() { int num[25]; int i,j,k=0; for(i=0;i<=24;i++) { printf("Enter numbers : "); scanf("%d",&num[i]); } printf("\nEnter the number to be searched : "); scanf("%d",&j); printf("\nthe is %d",j); for(i=0;i<=24;i++) { if(num[i]%j==0) k=k+1; } printf("\nIt is repeated %d times."k); }


Can you declare a function in the body of another function in c language?

yes, we can not declare a function in the body of another function. but if we declare a function in the body of another function then we can call that very function only in that particular function in which it is declared; and that declared function is not known to other functions present in your programme. So if a function is required in almost all functions of your programme so you must declare it outside the main function i.e in the beginning of your programme.


What portion of the structure of the atom primarily control the properties of elements?

The electron shells and the numbers of electrons present in them.


What type of function is the word sleeping?

The word "sleeping" functions as a verb in its present participle form. It describes the action of being in a state of sleep. Additionally, it can also function as an adjective when used to describe a noun, such as in "sleeping bag."


What must every c program have?

A main function must be present in every C program.

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)


Does the nook show page numbers?

Yes, Nook e-readers display page numbers, but the way they present them can vary depending on the book format and publisher settings. Some books might show traditional page numbers, while others may display location numbers or percentage completed. Additionally, Nook devices allow users to customize their reading experience, including font size and layout, which can affect how page numbers are presented.


What is the present tense of the word displayed?

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


To present or hold up to view?

display


What are to different meanings for project?

To display or to present


Where is a divison sign on a keyboard?

The division sign ÷ can typically be found on a standard keyboard above the 7 key on the numerical keypad, or sometimes as an alternate function of the forward slash / key. You can usually access it by holding the Shift key while pressing the desired key.


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.


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.


What is the function of thermometer in a autoclave?

The function of a thermometer in an autoclave is to measure and display the temperature inside the autoclave chamber. This is important to ensure that the sterilization process reaches the required temperature for a specified period of time in order to effectively kill any microorganisms present on the instruments being sterilized.


When oxygen is not present what does not function?

electron transport chain does not function


What is the synonmyon of display?

A synonym for "display" is "exhibit." Other alternatives include "show," "present," and "demonstrate," depending on the context in which it is used.


What is the Function of education in present context?

what are the functions of education in the present day context