Skip to content
Related Articles

Related Articles

GATE | GATE-IT-2004 | Question 69
  • Last Updated : 15 Dec, 2015
GeeksforGeeks - Summer Carnival Banner

Consider the following program module:

int module1 (int x, int y) {
    while (x! = y) {
        if (x > y)
             x = x - y,
        else y = y - x;
        }
    return x;
}

What is Cyclomatic complexity of the above module?
(A) 1
(B) 2
(C) 3
(D) 4


Answer: (C)

Explanation: Condition nodes :

1.While

2. if

Cyclomatic Complexity=2+1=3

 

Quiz of this Question

sudo-gate-course

My Personal Notes arrow_drop_up
Recommended Articles
Page :