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 |
Is c++ slower than c?
what is data Abstraction
What is c++ iterator?
What is a hashmap c++?
How would you represent an error detected during constructor of an object?
Why namespace is used in c++?
why all c++ program must have default constructor?
Can turbo c++ run c program?
What is c++ manipulator?
How is objective c different from c++?
Why cstdlib is used in c++?
How does throwing and catching exceptions differ from using setjmp and longjmp?