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
Can we declare a function inside a function in c?
What is assert and when would I use it?
Difference between MAC vs. IP Addressing
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
In a header file whether functions are declared or defined?
Can we replace the struct function in tree syntax with a union?
Is it possible to have a function as a parameter in another function?
What is difference between structure and union in c?
Is c procedural or object oriented?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Explain the concept and use of type void.
Write a program to print factorial of given number using recursion?
Explain can you assign a different address to an array tag?
What are the types of unary operators?
What is the difference between char array and char pointer?