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 set in c++?
What are arrays c++?
How would you use the functions randomize() and random()?
What are pointers used for c++?
What is endianness?
How do you remove an element from a set in c++?
Does c++ support multilevel and multiple inheritances?
What is the type of this pointer in c++?
What is a loop? What are different types of loops in c++?
Is c++ map a hash table?
Is swift faster than c++?
What do you mean by overhead in c++?
What are the classes in c++?
Is overriding possible in c++?
What are c++ variables?