-
What is the output of this program?
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main ()
{
int num[] = {5, 10, 11};
int Remainder[4];
transform ( num, num + 4, Remainder,
bind2nd(modulus<int>(), 2) );
for (int k = 0; k < 4; k++)
cout << (Remainder[k] == 1 ? "Odd" : "Even") << "\n";
return 0;
}
-
- Odd
Even
Odd
Even - Odd
Even
Even
Odd
- Odd
Odd
Even
Even - Even
Even
Odd
Odd - Even
Odd
Even
Odd
- Odd
Correct Option: A
Running the program will show above behaviour because we have given the value in for loop as 4 instead of 3.