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

14 Answers   Accenture,


How do you print a string on the printer?

0 Answers  


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

0 Answers  


Can we change the basic meaning of an operator in c++?

0 Answers  


What are the advantages of using pointers in a program?

0 Answers  






Copy Linked List using recursive function?

2 Answers   Persistent,


How to create a pure virtual function?

1 Answers  


Is sorted c++?

0 Answers  


Is c++ vector dynamic?

0 Answers  


What do you mean by vtable and vptr in c++?

0 Answers  


What are register variables?

0 Answers  


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

0 Answers  


Categories