CS FundamentalsModerateTCS NQT · Infosys

A method contains 3 if statements, 1 while loop and 1 for loop, with no && or || operators and no other branching. What is its cyclomatic complexity?

  1. A. 6
  2. B. 5
  3. C. 7
  4. D. 8

Correct answer: A. 6

V(G) = number of decision points + 1 = (3 + 1 + 1) + 1 = 6.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic