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
What are terms in math?
What is extern c used for?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is the right way to use errno?
What are the advantages and disadvantages of a heap?
Tell us something about keyword 'auto'.
explain what is fifo?
What is echo in c programming?
What is the use of c language in real life?
What is the correct code to have following output in c using nested for loop?
explain what is an endless loop?
Where in memory are my variables stored?
Describe the modifier in c?
What is the difference between class and object in c?
What are the applications of c language?