LogiQuest
Back to Templates
1

What will be the output of the program?

#include <iostream>
using namespace std;
template <typename T>
T maxOf(T a, T b) { return a > b ? a : b; }
int main() {
    cout << maxOf(3, 9) << " " << maxOf(2.5, 1.5) << endl;
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.