Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous

What will be the output of the following C++ code? #include <iostream> #include <algorithm> using namespace std; bool myfn(int i, int j) { return i < j; } int main () { int myints[ ] = {3, 7, 2, 5, 6, 4, 9}; cout << *min_element(myints, myints + 7, myfn) << '\n'; cout << *max_element(myints, myints + 7, myfn) << '\n'; return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option A • 2 9

Related Computer Questions

What is the purpose of the next keyword in a loop in Ruby? What is the optimal time required for solving the closest pair problem using divide and conquer approach? What is the purpose of multiple testing in statistical inference? For a heavily used program, which of these languages should be preferred? Choose the correct statements among the following: