Cyclomatic complexity of the flow graph given below is __________.
2026
Cyclomatic complexity of the flow graph given below is __________.

- A.
5
- B.
6
- C.
4
- D.
3
Attempted by 53 students.
Show answer & explanation
Correct answer: C
Cyclomatic complexity can be calculated using the formula: V(G) = P + 1, where P is the number of predicate nodes (decision nodes with out-degree > 1).
In the given flow graph, the decision nodes are 2, 3, and 4. Node 2 branches to 3 and 4. Node 3 branches to 5 and 6. Node 4 branches to 7 and 8.
Since there are 3 decision nodes, the cyclomatic complexity is 3 + 1 = 4.