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



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

Answer / 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

More C++ General Interview Questions

What is meant by reference variable in C++?

1 Answers  


advantages and disadvantages of using Borland C++ / version 5.

1 Answers  


what are function pointers?

0 Answers  


How can you say that a template is better than a base class?

0 Answers  


In a function declaration what does extern means?

0 Answers   Flextronics,


What is static function? Explain with an example

0 Answers  


What is a singleton c++?

0 Answers  


What is an iterator?

0 Answers  


How to detect memory leaks in c++

1 Answers   Mphasis,


class X { private: int a; protected: X(){cout<<"X constructor was called"<<endl;} ~X(){cout<<"X destructor was called"<<endl} }; Referring to the code above, which one of the following statements regarding "X" is TRUE? a) X is an abstract class. b) Only subclasses of X may create X objects. c) Instances of X cannot be created. d) X objects can only be created using the default copy constructor. e) Only friends can create instances of X objects.

2 Answers   Quark,


Why do we need constructors in c++?

0 Answers  


What are mutator methods in c++?

0 Answers  


Categories