Question: trace values multiple choice Trace the values of the variables a and b in the following block of code: int a = 0; // Note:

Trace the values of the variables a and b in the following block of code: int a = 0; // Note: Unlike this problem, you should use meaningful variable names. int b = -1; if (a > 0) a = a - 1; } else if (b> ) { b = b + 1; } 1/ Checkpoint 1 if (a - b) a -a + 1; else if (b > 0) b = b - 1; else b = b + 1; } // Checkpoint 2 { a = a - 1; } else if (b > 0) { b- b + 1; } // Checkpoint 1 if (a - b) { a = a + 1; } else if (b >= 0) { b = b - 1; } else { b = b + 1; } // Checkpoint 2 What are the values of a and b when the program reaches Checkpoint 1? At Checkpoint 2? Checkpoint la 1b-0, Checkpoint 2. a -0,6-0 Checkpoint 1 a 0,6-1, Checkpoint 2 a 0,6-0 Checkpoint 1. a - b - 1. Checkpoint 2 a 0,0) = -1 Checkpoint 1 a 0,6-0, Checkpoint 2a-150
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
