How many test cases are required for 100% statement and branch coverage of the following source code?

Question:

How many test cases are required for 100% statement and branch coverage of the following source code?

void main ( )

{

int

a, b;

scanf (“%d”, &a);

scanf (“%d”, &b);

if (a>b) {

printf (“a is large”);

}

else {

printf (“b is large”);

}

}

(a) 1 test case for statement coverage, 2 for branch coverage.

(b) 2 test case for statement coverage, 1 for branch coverage.

(c) 2 test case for statement coverage, 2 for branch coverage.

(d) 1 test case for statement coverage, 3 for branch coverage.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: