to get a line of text and count the number of vowels in it
Answer Posted / swe
#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':count++;
break;
case 'A':count++;
break;
case 'e':count++;
break;
case 'E':count++;
break;
case 'i':count++;
break;
case 'I':count++;
break;
case 'o':count++;
break;
case 'O':count++;
break;
case 'u':count++;
break;
case 'U':count++;
break;
}
}
printf("\n Number of vowels:%d",count);
getch();
}
Is This Answer Correct ? | 32 Yes | 15 No |
Post New Answer View All Answers
Explain how do you determine whether to use a stream function or a low-level function?
What is const keyword in c?
How do you print an address?
What is advantage of pointer in c?
What does c in a circle mean?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is array of structure in c programming?
What is the use of pragma in embedded c?
How does sizeof know array size?
What are # preprocessor operator in c?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
What is the size of enum in bytes?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What is the difference between the expression “++a” and “a++”?
What is a structure and why it is used?