#include<conio.h>
void main()
{
char str[50];
int vowels = 0, i = 0;
clrscr();
printf(“nnt ENTER A STRING…: “);
gets(str);
while(str[i] != ‘′)
{
if(str[i]==’A’ || str[i]==’a’ || str[i]==’E’ || str[i]==’e’ || str[i]==’I’ || str[i]==’i’ ||
str[i]==’O’ || str[i]==’o’ || str[i]==’U’ || str[i]==’u’)
vowels++;
i++;
}
printf(“nnt THE TOTAL NUMBER OF VOWELS IS…: %d”, vowels);
getch();
}
Not Satisfied ? Just search & get the result
Related posts:
- C program read a sentence and count the number of number of vowels and consonants in the given sentence. Output the results on two lines with suitable headings
- C Program – Find the total number of palindrome in a given string
- C program to accept a string and find the number of times the word ‘the’ appears in it
- C program – To check whether the given string is palindrome
- Sample – Program to enter a sentence and output the number of uppercase & lowercase consonants, uppercase & lowercase vowels in sentence..
