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 setbase c++?
What are punctuators in c++?
How compile and run c++ program in turbo c++?
How java is different from c and c++?
What is main function in c++ with example?
Is map thread safe c++?
What are c++ manipulators?
What are c++ files?
How is new() different from malloc()?
What do you mean by a template?
Can we overload operator in c++?
Define namespace in c++?
Explain the scope of resolution operator.
Explain object slicing in c++?
What is c++ mutable?