Examveda

What will be the output of the following C++ code?
#include <iostream>
#include <functional>
#include <algorithm>
using namespace std;
int main ()
{
    int first[] = {10, 40, 90};
    int second[] = {1, 2, 3};
    int results[5];
    transform ( first, first + 5, second, results, divides<int>());
    for (int i = 0; i < 3; i++)
        cout << results[i] << " ";
    return 0;
}

A. 10 20

B. 20 30

C. 10 20 30

D. 20 40

Answer: Option C


Join The Discussion

Related Questions on C plus plus miscellaneous

What is the difference between '++i' and 'i++' in C++?

A. None of the above

B. They both have the same effect

C. '++i' increments the value of 'i' before returning it, while 'i++' increments the value of 'i' after returning it

D. '++i' increments the value of 'i' after returning it, while 'i++' increments the value of 'i' before returning it