Reading code
Week 2 Quiz Execute the following code by hand: int anotherFunction(int a, int b) { int answer = 2; int x = 0; printf("In anotherFunction(%d,%d)\n",a,b); while (b > a) { printf("a is %d, b is %d\n", a, b); answer = answer + (b - a); b -= x; a += x / 2; x++; } return answer; } int someFunction(int x, int y) { int a = x + y; if (x < y) { for (int i = 0; i < x; i++) { printf("In the loop with i = %d, a = %d\n", i, a); a = a + x; } } else { y = anotherFunction(y,a+1); } return a * (y-10); } int main(void) { int x = 2; int b = someFunction(3,x); printf("b = %d\n", b); printf("x = %d\n", x); return 0; } Execute main main //setep 1, execute main box, jump to calculate functions in b box. // get result from step 3 in y box, print first 4 lines In anotherFunction(2,6) a is 2, b is 6 a is 2, b is 6 a is 2, b is 5 //step 5, come back to main box, input last step value b=15 //step 6, print last two lines. b=15; x=2; b = someFunction(3,2); ...