Consider the following if statement
if ((condition_1) && (condition_2) && ... (condition_n)) {
// do something
}
Where condition_1, condition_2, … condition_n are n independent boolean variables. You are given the following criteria:
(i) Every condition_i should be true or false at least once
(ii) For every condition_i there should be a pair of two test cases, such that only condition_i is different in the two and the result of the expression is different
Assume that you can give condition_1, condition_2, … condition_n as input to the program. The minimum number of test cases required to satisfy the above criteria are:
N+1
2^N
2N
2^(N-1)
Boost your performance with adaptive practice tests
Practice every concept in the syllabus
Compare your speed and accuracy with your peers
Download the app and practice on the go