Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

GATE | GATE-IT-2004 | Question 69

  • Last Updated : 28 Jun, 2021

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 :

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

1.While



2. if

Cyclomatic Complexity=2+1=3

 

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!