Put the breakpoint in a condition

Report a typo

A programmer wrote pseudocode for an algorithm that takes two numbers as input. It subtracts B from A and uses them in a conditional statement. If A is larger than 0, the code will return the sum of A and B. Else, the code will return 0.

BEGIN
    NUMBER A, B
    A = A - B
    if A < 0
    { 
      sum = A + B
      RETURN sum
    }
    RETURN 0
END

But, after running the code with values A = 5 and B = 6 you see an error. The code unexpectedly returned 11 instead of 0. Now, you need to check the value of A before the conditional statement execution. Where should you put a breakpoint?

Select one option from the list
___

Create a free account to access the full topic