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 the advantage of an array over individual variables?
What is the correct declaration of main?
What is New modifiers?
Write a program to swap two numbers without using third variable in c?
code for replace tabs with equivalent number of blanks
What does 3 periods mean in texting?
What should malloc(0) do?
code for find determinent of amatrix
Why is c still so popular?
Explain what is the difference between the expression '++a' and 'a++'?
Is c is a middle level language?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
Lists the benefits of c programming language?
what is the basis for selection of arrays or pointers as data structure in a program
What are the types of arrays in c?