in IS&Software Engineering retagged by
3,837 views
3 votes
3 votes

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
in IS&Software Engineering retagged by
3.8k views

1 Answer

5 votes
5 votes
Best answer
answer - C

There are 2 decision points in this module

1. while condition and

2. if condition

hence cyclomatic complexity = number of decision points + 1 = 3
selected by
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true