Code: //Program to find no of vowels
#include<stdio.h>
int main()
{
int count;char letter;int vowel=0;
for(count=0;count<10;count++)
{
letter=getchar();
switch(letter)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':vowel++;
}printf("Count:%d",count);
}
printf("NO of vowels is %d\n",vowel);
return 0;
}
Output: a a s d f NO of vowels is 2
The program reads only 5 characters and then displays the expected output. I tried printing the value of 'count' and by the end of loop, it incremented to 10. But,I am not able to read the number of characters(10) equivalent to my for loop condition. Please help.