Exam CTFL All QuestionsBrowse all questions from this exam
Question 81

Given the Following program IF X <>= ZTHEN Statement 2;ENDMcCabe’s Cyclomatic Complexity is :

    Correct Answer: A

    The McCabe’s Cyclomatic Complexity is calculated by counting the number of decision points (branches) in the program and adding 1 to it. In the given program, there is only one decision point: IF X <> Z. There are no other decision statements provided. Therefore, the cyclomatic complexity is 1 (decision point) + 1 = 2.

Discussion
msktOption: B

1st decision statement : x<>z 2nd decision statement : x=z Please consider that the easiest way to calculate McCabe's Cyclomatic Complexity is to sum the number of binary decision statements (if, while, for, etc) and add 1 to it. Therefore 2 statements + 1 = 3. The answer is 3.

AnshulAgrawal

Can someone please explain this?