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
What is the main function c++?
What is ostream in c++?
What is the use of default constructor?
Explain deep copy?
What is a set in c++?
What is the best book for c++ beginners?
How will you call C functions from C ++ and vice-versa?
How does list r; differs from list r();?
What are friend classes? What are advantages of using friend classes?
Explain the auto storage classes in c++.
What is a vector c++?
How do you add an element to a set in c++?
What is the difference between delegation and implemented-in-terms-of?
What is c++ iterator?
What is iomanip c++?