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

Answer Posted / chandra sekhar kommuri

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char st[100];
int i,count=0;
clrscr();
printf("Enter line of text:");
gets(st);
for(i=0;st[i]!='\0';i++)
switch(st[i])
{
case 'a':
case 'A':
case 'e':
case 'E':
case 'i':
case 'I':
case 'o':
case 'O':
case 'u':
case 'U':count++;
}
printf("\n Number of vowels:%d",count);
getch();
}

Is This Answer Correct ?    75 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

586


What is quick sort in c?

588


What is meant by operator precedence?

680


What is c language in simple words?

598


Do array subscripts always start with zero?

788






Explain what is a program flowchart and explain how does it help in writing a program?

652


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

587


Can we declare a function inside a function in c?

594


Q.1 write aprogram to stack using linklist o insert 40 items? Q.2 write a program to implement circular queue with help of linklist?

1602


What is substring in c?

643


What is pointer and structure in c?

576


Explain what is wrong with this statement? Myname = ?robin?;

1039


When should structures be passed by values or by references?

588


Why void is used in c?

569


What is a pointer on a pointer in c programming language?

623