Answer:
B. 1 6 3
Explanation:
Given function definition for calc:
void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}
Function invocation:
x = 1;
y = 2;
z = 3;
calc(x, y);
cout << x << " " << y << " " << z << endl;
- Since x is passed by value, its value remains 1.
- y is passed by reference to the function calc(x,y);
Tracing the function execution:
c=3
a=3
b=c+a = 6;
But b actually corresponds to y. So y=6 after function call.
- Since z is not involved in function call, its value remain 3.
So output: 1 6 3
Answer:humans need energy to complete the regular body requirements to digest our food,to breathe,to move,to run,to travel and continue the metabolism of our regular life.
Explanation:energy is essential to life and all living thing organisms.
Answer:
myInt=40
myFloat=4.8
Explanation:
First look at the function definition .It has two arguments intVal is passed by reference while floatVal is passed by value.So the changes done on the myInt variable will be reflected on the original argument because when a variable is passed by reference the the changes are reflected on the original argument but when a variable is passed by value the function created a duplicate copy of it and work on them so changes are not reflected on the original argument.So myInt will get doubled while myFloat will remain the same.
Because the string is invalid or your source is not attached to your search engine.