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
How to delete a node from linked list w/o using collectons?
can anyone please tell about the nested interrupts?
How can I call fortran?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What are the types of data types and explain?
How do you list files in a directory?
Explain indirection?
What is indirection?
Write programs for String Reversal & Palindrome check
What is variable in c example?
Why do we need arrays in c?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What is wrong in this statement? scanf(ā%dā,whatnumber);
Can we declare variables anywhere in c?
Where register variables are stored in c?