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
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Which programming language is best for getting job 2020?
Does * p ++ increment p or what it points to?
what is the structure pointer?
What is the difference between break and continue?
What is function what are the types of function?
What are variables and it what way is it different from constants?
What are the ways to a null pointer can use in c programming language?
What does %d do?
What is boolean in c?
What is the best way of making my program efficient?
Explain the term printf() and scanf() used in c language?
What is difference between %d and %i in c?
What is the purpose of & in scanf?
What is calloc()?