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 c language?
Why enum is used in c?
What is auto keyword in c?
What is the purpose of void pointer?
What are structures and unions? State differencves between them.
Write a program in c to replace any vowel in a string with z?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is time null in c?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is a char in c?
What will be the outcome of the following conditional statement if the value of variable s is 10?
How do you generate random numbers in C?
What is a shell structure examples?
What is array in c with example?
what is bit rate & baud rate? plz give wave forms