Tuesday, July 31, 2007

Exercise of cyclomatic complexity

What is the cyclomatic complexity below?
(A) 4
(B) 5
(C) 6


#!python
def func(x):
if x==0:
return 3
elif x==1:
return 4
elif x==2:
return 5
else:
return 0

1 comment:

Unknown said...
This comment has been removed by the author.