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 the types of assignment statements?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is the difference between procedural and declarative language?
Can a variable be both constant and volatile?
Why void is used in c?
Write a program to swap two numbers without using third variable?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
How does normalization of huge pointer works?
Explain do array subscripts always start with zero?
What does sizeof return c?
What are extern variables in c?
Is main is a keyword in c?
How can you restore a redirected standard stream?
How do you sort filenames in a directory?
What are multidimensional arrays?