The syntax of the function template is template<classType> function definition;
ID: 3614580 • Letter: T
Question
The syntax of the function template istemplate<classType>
function definition;
where Type is referred to as a formal parameter of the template. Itis used to specify the type of parameters
of the function and the return type of the function, and to declarevariables within the function. Look at the
following code:
template<classType>
Type larger(Type x,Type y)
{
if(x>=y)
return x;
else
return y;
}
A) This code defines the function template called ____.
a. x
b. y
c. larger
d. Type
B) Based on the template above, what will the following code outputto the screen:
cout << larger(5,6) << endl; ?
a. x
b. y
c. 5
d. 6