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

Difference between a homogeneous and a heterogeneous container

0 Answers  


What is a protocol class?

1 Answers  


Is c++ a dying language?

0 Answers  


What is a Default constructor?

1 Answers  


Explain function overloading and operator overloading.

0 Answers  






What is the main purpose of overloading operators?

0 Answers  


write a porgram in c++ that reads an integer and print the biggest digit in the number

0 Answers  


What issue do auto_ptr objects address?

2 Answers  


What is static class data?

0 Answers  


C++ program output? Explain output of this program. #include <iostream> using std::cout; using std::cin; int main() {   cout<<cout<<' ';   cout<<cin;   return 0; } It prints some address in hexadecimal. what is it?

1 Answers  


What is stack unwinding?

0 Answers  


Is there any difference between dlearations int* x and int *x? If so tell me the difference?

16 Answers   Lason,


Categories