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 Function Output

C++ quiz · Question 54
easyTemplates

What is the output of the following program?

#include <iostream>
using namespace std;

template <typename T>
void printDouble(T x) {
    cout << x * 2 << "\n";
}

int main() {
    printDouble(5);
    printDouble(2.5);
}