GATE | Gate IT 2007 | Question 53

Consider the following pseudo-code:

filter_none

edit
close

play_arrow

link
brightness_4
code

IF ((A > B) AND (C > D)) THEN
       A = A + 1
       B = B + 1
ENDIF

chevron_right


The cyclomatic complexity of the pseudo-code is
(A) 2
(B) 3
(C) 4
(D) 5


Answer: (C)

Explanation: Cyclomatic complexity = (π − s + 2)
where π is the number of decision points in the program, and s is the number of exit points.


Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.