Open In App

UGC-NET | UGC NET CS 2018 Dec – II | Question 86

Last Updated : 16 Sep, 2020
Like Article
Like
Save
Share
Report

Consider the following method :

int f(int m, int n, boolean x, boolean y) {
  int res = 0;
  if (m < 0) {
    res = n - m;
  } else if (x || y) {
    res = -1;
    if (n == m) {
      res = 1;
    }
  } else {
    res = n;
  }
  return res;
} /*end of f */

If P is the minimum number of tests to achieve full statement coverage for f() and Q is the minimum number of tests to achieve full branch coverage for f(), then (P,Q) =
(A) (3,4)
(B) (3,2)
(C) (2,3)
(D) (4,3)


Answer: (A)

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads