Experiment - 9 Control Flow Graph
Experiment - 9 Control Flow Graph
Method 1:
N = 7, E = 8
Cyclomatic Complexity (V) = E - N + 2
V=E−N+2
8−7+2=3
Method 2:
V = Number of bounded areas + 1
There are 2 bounded areas:
1. The IF A = 354 block.
2. The IF B > C block inside it.
V= 2+1 = 3
Method 1:
N = 10, E = 16
Cyclomatic Complexity (V) = E - N + 2
V=16−10+2=8
Method 2:
V = Number of Bounded Areas + 1
Bounded Areas:
1. if (y < 0) block
2. while (power! = 0) block
3. Inner if (y < 0) block
V=3+1=4