to get a line of text and count the number of vowels in it

Answer Posted / anil kumar nahak

void main()
{
char *st;
int i=0,c=0;
printf("\n Enter A String:");
gets(st);
while(st[i]!='\0')
{
if(st[i]=='a' || st[i]=='A' || st[i]=='e' || st[i]=='E'
st[i]=='i' || st[i]=='I' || st[i]=='o' st[i]=='O' st[i]=='u'
|| st[i]=='U')
c++;
i++;
}

printf("\n the Number Of Vowels Present In The String Is :
%d",c);

}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to find anagram without using string functions using only loops in c programming

2685


Explain what are multidimensional arrays?

579


Subtract Two Number Without Using Subtraction Operator

330


Suggesting that there can be 62 seconds in a minute?

572


What is an endless loop?

779






How can I change the size of the dynamically allocated array?

601


What is I ++ in c programming?

597


When should you not use a type cast?

628


What is the use of bitwise operator?

661


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14892


Explain what is the concatenation operator?

601


How can I direct output to the printer?

777


Does sprintf put null character?

563


What is a floating point in c?

573


What are pointers really good for, anyway?

591