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 different types of linkage exist in c?
#include
What is the difference between malloc() and calloc() function in c language?
Write a program which returns the first non repetitive character in the string?
How can this be legal c?
Why does everyone say not to use scanf? What should I use instead?
Why c is a mother language?
What is the purpose of void in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
How can you determine the maximum value that a numeric variable can hold?
What is hungarian notation? Is it worthwhile?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Disadvantages of C language.
What is sorting in c plus plus?
Can we add pointers together?