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

Is c++ slower than c?

0 Answers  


what is data Abstraction

2 Answers  


What is c++ iterator?

0 Answers  


What is a hashmap c++?

0 Answers  


How would you represent an error detected during constructor of an object?

1 Answers  






Why namespace is used in c++?

0 Answers  


why all c++ program must have default constructor?

6 Answers   IBM,


Can turbo c++ run c program?

0 Answers  


What is c++ manipulator?

0 Answers  


How is objective c different from c++?

0 Answers  


Why cstdlib is used in c++?

0 Answers  


How does throwing and catching exceptions differ from using setjmp and longjmp?

1 Answers  


Categories