Draw a series of variable diagrams for the program below. Use the conventions of the Study Guide. You do not have to submit this question.
1 // variable diagrams revisited 2 #include 3 using namespace std; 4 const int C = 200; 5 int func1(int n, int n1) 6 { 7 n += 3; 8 n1 -= n;9 return 2 + n + n1 * C; 10 } 11 void func2(int n, int & n1) 12 { 13 n = C * n1; 14 n1 = n - n1; 15 } 16 void func3(int & n, int & n1) 17 { 18 int k; 19 k = n1 + 3; 20 n = k * 30; 21 n1 = n + 2 * k; 22 } 23 int main( ) 24 { 25 int n, m, j;
COS1511/101
47
26 n = 5; 27 m = 10; 28 j = func1(n, m); 29 n = 15; 30 m = 20; 31 func2(n, m); 32 n = 25; 33 m = 30; 34 func3(n, m); 35 36 return 0; 37 }