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


Please Help Members By Posting Answers For Below Questions

What is setbase c++?

727


What are punctuators in c++?

765


How compile and run c++ program in turbo c++?

743


How java is different from c and c++?

815


What is main function in c++ with example?

651






Is map thread safe c++?

741


What are c++ manipulators?

702


What are c++ files?

683


How is new() different from malloc()?

738


What do you mean by a template?

724


Can we overload operator in c++?

657


Define namespace in c++?

726


Explain the scope of resolution operator.

729


Explain object slicing in c++?

687


What is c++ mutable?

791