CS FundamentalsHardGATE CS (PYQ pattern)

A program consists of a main routine and one procedure. Their flow graphs are drawn as two separate connected components with a total of E = 21 edges and N = 17 nodes. The cyclomatic complexity of the whole program is:

  1. A. 6
  2. B. 8
  3. C. 10
  4. D. 4

Correct answer: B. 8

With P connected components, V(G) = E − N + 2P = 21 − 17 + 4 = 8. Using the single-component formula E − N + 2 would give 6, which is the common slip.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic