Show a formal walkthrough of the program section shown below. Use the line numbers found in the comments, to identify in
Posted: Sat May 14, 2022 3:52 pm
Show a formal walkthrough of the program section shown below.
Use the line numbers found in the comments, to identify
instructions as they execute. Show the exact output produced, in a
separate area of your answer.
int main()
{
int a, b;
a
= 10; //Line
1
b
= -5; //Line
2
fun2(a,
b ); //Line
3
cout << "a = " << a << ", b
= " << b <<
endl; //Line 4
return 0;
}
void fun2( int& m,
int n) //Line
f1
{
int j;
j = m
+ n; //Line
f2
n
= 2*m; //Line
f3
m = j
- 3; //Line
f4
cout << "In fun2, m = " <<
m << ", n = " << n << endl; //Line
f5
}
Use the line numbers found in the comments, to identify
instructions as they execute. Show the exact output produced, in a
separate area of your answer.
int main()
{
int a, b;
a
= 10; //Line
1
b
= -5; //Line
2
fun2(a,
b ); //Line
3
cout << "a = " << a << ", b
= " << b <<
endl; //Line 4
return 0;
}
void fun2( int& m,
int n) //Line
f1
{
int j;
j = m
+ n; //Line
f2
n
= 2*m; //Line
f3
m = j
- 3; //Line
f4
cout << "In fun2, m = " <<
m << ", n = " << n << endl; //Line
f5
}