Consider the following pseudo-code:
I = 0; J = 0; K = 8; while (IThe cyclomatic complexity of the above is
(A) 3
(B) 2
(C) 4
(D) 1
Answer: (C)
Explanation: Cyclomatic complexity of a code section is the quantitative measure of the number of linearly independent paths in it.There are two while loop, for each there is two possible paths, either true or false.
So, total cyclomatic complexity is = 2*2 = 4 which is answer.
Quiz of this Question
Article Tags :
Recommended Articles