Ans is (3,4)
Full statement coverage means execution of all the executable statements in the source code at least once. So here,
first time keep m<0 to cover statements of if block
second time keep (x>0 or y>0) and (n==m) to cover all statements of else if block
third time make above 2 conditiions false so that else block is executed.
Thus P= 3
In the branch coverage, every outcome from a code should be tested.
Here there are 4 outcomes possible, res = n-m, res= -1, res= 1, res = n. Observe else if block has 2 outcomes and therefore both should be covered which will require 2 test cases. if block and else block will require only 1 -1 testcases.
thus Q= 4