In the Mini project 8th module is to find the number of vowel letters in a word(consider both uppercase and lowercase). Rita allotted this function to Patrick.
Help Patrick to write a program to find the number of vowel letters in a word.
Function Specification:
int findNumberOfVowels(char *);
Input format :
Input consists of a string.
Output format :
The output consists of an integer saying the number of the vowel in the given word.
Refer sample Input and Output for further specifications.
[ All text of bold corresponds to the input and the rest corresponds to output. ]

Sample Input and Output format :
Enter the word :
Alice
Count of vowels in Alice is 3

Program Code:
#include<stdio.h>
int findNumberOfVowels(char *a) 
{
   int i,vow=0; 
    for(i=0;a[i]!='\0';i++)
{
    if(a[i]=='a' || a[i]=='A' || a[i]=='e' || a[i]=='E' || a[i]=='i' || a[i]=='I' || a[i]=='o' || a[i]=='O' || a[i]=='u' || a[i]=='U')
vow=vow+1;
}
return vow;
}
int main()
{
char a[100],k;
printf("Enter the word :\n");
gets(a);
k=findNumberOfVowels(a);
printf("Count of vowels in %s is %d",a,k);
return 0;
}
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

2 comments: