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...

wap to accept 10 numbers & display the number of odd and
even numbers??

Answer Posted / suman_kotte

void main()
{
int a[10],i,even=0,odd=0;
cout<<"enter 10 num's";
for(i=1;i<=10;i++)
{
cin>>a[i];
}
for(i=1;i<=10;i++)
{
if(a[i]%2==0)
even++;
else
odd++;
}
cout<<"the num of even num"<<even;
cout<<"the num of odd num"<<odd;
}

Is This Answer Correct ?    17 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main function c++?

1070


What is ostream in c++?

962


What is the use of default constructor?

1044


Explain deep copy?

996


What is a set in c++?

919


What is the best book for c++ beginners?

983


How will you call C functions from C ++ and vice-versa?

1081


How does list r; differs from list r();?

1091


What are friend classes? What are advantages of using friend classes?

1044


Explain the auto storage classes in c++.

1056


What is a vector c++?

1103


How do you add an element to a set in c++?

935


What is the difference between delegation and implemented-in-terms-of?

962


What is c++ iterator?

1056


What is iomanip c++?

1011