CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Template Type Deduction

C++ quiz · Question 55
mediumTemplates

What is the output of this code?

#include <iostream>
using namespace std;

template <typename T>
T addOne(T x) {
    return x + 1;
}

int main() {
    cout << addOne(4) << "\n";
    cout << addOne(4.9) << "\n";
}