Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is the advantage of an array over individual variables?

1243


What is the correct declaration of main?

1217


What is New modifiers?

1135


Write a program to swap two numbers without using third variable in c?

1138


code for replace tabs with equivalent number of blanks

2167


What does 3 periods mean in texting?

1071


What should malloc(0) do?

1131


code for find determinent of amatrix

1972


Why is c still so popular?

1050


Explain what is the difference between the expression '++a' and 'a++'?

1220


Is c is a middle level language?

1070


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1222


Lists the benefits of c programming language?

1144


what is the basis for selection of arrays or pointers as data structure in a program

4311


What are the types of arrays in c?

1181