Consider the following program module: int module1(int x, int y) { while (x !=…

PYQ GATE 2004

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 the cyclomatic complexity of the above module?

  1. A.

    1

  2. B.

    2

  3. C.

    3

  4. D.

    4

Attempted by 193 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…