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


Please Help Members By Posting Answers For Below Questions

What are the types of unary operators?

667


When do we get logical errors?

642


Is python a c language?

555


What is main () in c?

590


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.

1574






With the help of using classes, write a program to add two numbers.

622


How many types of functions are there in c?

587


What is anagram in c?

521


Can you please explain the scope of static variables?

608


What is volatile variable how do you declare it?

570


Which is an example of a structural homology?

790


Does c have an equivalent to pascals with statement?

578


What are the application of c?

652


How would you use the functions fseek(), freed(), fwrite() and ftell()?

709


Write a c program to demonstrate character and string constants?

1689