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
Why is sprintf unsafe?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
where are auto variables stored? What are the characteristics of an auto variable?
What is difference between class and structure?
All technical questions
What is extern variable in c with example?
What are the types of i/o functions?
Explain how do you determine the length of a string value that was stored in a variable?
develop algorithms to add polynomials (i) in one variable
Why void is used in c?
What are the advantages and disadvantages of c language?
how do you execute a c program in unix.
What is a string?
What is return in c programming?
Explain why C language is procedural?