What is the output of this code, given the following function definition? int x
ID: 3540029 • Letter: W
Question
What is the output of this code, given the following function definition?
int x = 5, y = 2;
y = mixUp (x, y);
cout << x;
//function definition
int mixUp (int &p, int t)
{
p = p * t;
return p + 1;
}
In the definition of a function, when should a parameter be a value parameter?
Answer
This part of a function definition consists of one or more statements that are executed when the function is called.
Answer
NOTE: checkboxes, this is a multiple answer question.
In the definition of a function, when should a parameter be a reference parameter?
Answer
Explanation / Answer
1. Output : 10
2. When the parameter is carrying information into the function that does not have to be returned
3. body , header , return statement
4. When the parameter carrying information into the function may be changed and its new value should be returned
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.