All mock tests are FREE till 31 December — register to save your progress
Unit 6 · Software Engineering Paper 2 CS · June 2024 (Cancelled Exam)

The cyclomatic complexity of the following flow graph is: nodes 1, 2, 3, 4, 5, 6, 7, 9, 10 with edges 1→2, 1→10, 2→3, 2→4, 3→9, 4→5, 4→6, 5→7, 6→7, 7→9, 9→1.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 4

Explanation

E = 11 and N = 9 (there is no node 8), so V(G) = E − N + 2 = 4. Equivalently, there are 3 decision nodes (1, 2, 4), giving 3 + 1 = 4.

More Software Engineering questions