What is the cyclomatic complexity of a module which has seventeen edges and…

2013

What is the cyclomatic complexity of a module which has seventeen edges and thirteen nodes?

  1. A.

    4

  2. B.

    5

  3. C.

    6

  4. D.

    7

Attempted by 43 students.

Show answer & explanation

Correct answer: C

Cyclomatic complexity V(G) is calculated using the formula V(G) = E - N + 2P, where E is edges, N is nodes, and P is the number of connected components. Given 17 edges (E=17) and 13 nodes (N=13), assuming one connected component (P=1): V(G) = 17 - 13 + 2(1) = 6.

Explore the full course: Isro