Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

GATE | GATE CS 2010 | Question 44

  • Last Updated : 28 Jun, 2021

The following program is to be tested for statement coverage:

begin
  if (a== b) {S1; exit;}
  else if (c== d) {S2;]
       else {S3; exit;}
  S4;
end 

The test cases T1, T2, T3 and T4 given below are expressed in terms of the properties satisfied by the values of variables a, b, c and d. The exact values are not given.

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

T1 : a, b, c and d are all equal
T2 : a, b, c and d are all distinct
T3 : a = b and c != d
T4 : a != b and c = d
Which of the test suites given below ensures coverage of statements S1, S2, S3 and S4?
(A) T1, T2, T3
(B) T2, T4
(C) T3, T4
(D) T1, T2, T4


Answer: (D)

Explanation:

T1 checks S1 

T2 checks S3

T4 checks S2 and S4


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :