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
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
What is quick sort in c?
What is meant by operator precedence?
What is c language in simple words?
Do array subscripts always start with zero?
Explain what is a program flowchart and explain how does it help in writing a program?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
Can we declare a function inside a function in c?
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?
What is substring in c?
What is pointer and structure in c?
Explain what is wrong with this statement? Myname = ?robin?;
When should structures be passed by values or by references?
Why void is used in c?
What is a pointer on a pointer in c programming language?