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


Please Help Members By Posting Answers For Below Questions

Can we declare a function inside a function in c?

574


What is assert and when would I use it?

571


Difference between MAC vs. IP Addressing

629


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

637


In a header file whether functions are declared or defined?

625






Can we replace the struct function in tree syntax with a union?

768


Is it possible to have a function as a parameter in another function?

592


What is difference between structure and union in c?

533


Is c procedural or object oriented?

567


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

805


Explain the concept and use of type void.

619


Write a program to print factorial of given number using recursion?

595


Explain can you assign a different address to an array tag?

634


What are the types of unary operators?

651


What is the difference between char array and char pointer?

519