2,468 views

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?

1. 1
2. 2
3. 3
4. 4

There are 2 decision points in this module

1. while condition and

2. if condition

hence cyclomatic complexity = number of decision points + 1 = 3