Create a list to store the names of five people and count the number of vowels in it.

#include <stdio.h>

int main(void)
{
char names[5][30];
int i, j, vowels = 0;
clrscr();
for(i = 0 ; i < 5 ; i++)
{
printf("\nName %d :", i+1);
gets(names[i]);
}

for(i = 0 ; i < 5 ; i++)

{
for(j = 0 ; names[i][j] != '\0' ; j++)
{
if(names[i][j] == 'a' || names[i][j] == 'e' ||
names[i][j] == 'i' || names[i][j] == 'o' ||
names[i][j] == 'u')
vowels++;
}
}

printf("\nTotal number of vowels is %d", vowels);

getch();
return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin