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
Where are c variables stored in memory?
Explain how are portions of a program disabled in demo versions?
Are there constructors in c?
praagnovation
What is 2c dna?
What are the 32 keywords in c?
How do you use a 'Local Block'?
What are pointers? Why are they used?
Describe explain how arrays can be passed to a user defined function
What is the heap in c?
What is getch c?
What is the use of clrscr?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What does. int *x[](); means ?
What is C language ?