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 |
What is void pointer in c++ with example?
explain the reference variable in c++?
What is istream and ostream in c++?
Do you know what is overriding?
What is lambda expression c++?
Why iomanip is used in c++?
Why we use #include iostream in c++?
"How will you merge these two arrays? Write the program Array: A 1 18 22 43 Array: B 3 4 6 20 34 46 55 Output Array: C 1 3 4 6 18 20 22 34 43 46 55"
9 Answers College School Exams Tests, HCL,
Explain virtual class?
If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?
What do you mean by const correctness?
Why preincrement operator is faster than postincrement?