to get a line of text and count the number of vowels in it
Answer Posted / vadivel t
#include<stdio.h>
#include<conio.h>
int main()
{
char ptr[100]= "She lives in NEWYORK";
printf("VOWELS EXIST %d TIME(S)\n",CountVow(ptr));
getch();
}
int CountVow(char *ptr)
{
int count = 0;
while(*ptr != '\0')
{
if((*ptr == 'a') || (*ptr == 'A') || (*ptr == 'e') ||
(*ptr == 'E') || (*ptr == 'i') ||
(*ptr == 'I') || (*ptr == 'o') || (*ptr == 'O') ||
(*ptr == 'u') || (*ptr == 'U'))
{
count++;
}
ptr++;
}
return count;
}
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is #include stdio h and #include conio h?
What is the difference between c and python?
What is sizeof array in c?
How can I do peek and poke in c?
Explain what is the concatenation operator?
What would be an example of a structure analogous to structure c?
Explain the bubble sort algorithm.
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
What is a stream?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
Do character constants represent numerical values?
What is the use of #include in c?
What are the types of c language?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Explain how can I make sure that my program is the only one accessing a file?