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 are the types of unary operators?
When do we get logical errors?
Is python a c language?
What is main () in c?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
With the help of using classes, write a program to add two numbers.
How many types of functions are there in c?
What is anagram in c?
Can you please explain the scope of static variables?
What is volatile variable how do you declare it?
Which is an example of a structural homology?
Does c have an equivalent to pascals with statement?
What are the application of c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
Write a c program to demonstrate character and string constants?