Exam4Training

Which of the following test cases will ensure that the statement ‘Print ‘Hold’’ is exercised?

Refer to the exhibit

Which of the following test cases will ensure that the statement ‘Print ‘Hold’’ is exercised? [K3]
A . X=2, Y=2, Z=2
B . X=2, Y=3, Z=4
C . X=2, Y=4, Z=3
D . X=4, Y=3, Z=2

Answer: C

Explanation:

The question asks which of the test cases will ensure that the statement ‘Print ‘Hold’’ is exercised. The statement ‘Print ‘Hold’’ is executed when X > Y and Z < Y. Therefore, to exercise this statement, we need to choose a test case that satisfies these conditions. Among the options given in this question, only C satisfies these conditions. X = 42 > Y =43 and Z =42 < Y =43. Therefore, C is the correct answer.

Exit mobile version