recategorized by
6,077 views

3 Answers

Best answer
9 votes
9 votes

The answer is 3 because:

The cyclomatic complexity of any structured program with only one entrance point and one exit point is equal to the number of decision points (i.e., "if" statements or conditional loops) contained in that program plus one. However, this is true only for decision points counted at the lowest, machine-level instructions. Decisions involving compound predicates like those found in high-level languages like IF cond1 AND cond2 THEN ... should be counted in terms of predicate variables involved, i.e. in this examples one should count two decision points, because at machine level it is equivalent to IF cond1 THEN IF cond2 THEN ....

Cyclomatic complexity may be extended to a program with multiple exit points; in this case it is equal to:

π − s + 2,
where π is the number of decision points in the program, and s is the number of exit points.

Source: Wikepedia

selected by
0 votes
0 votes
Answer is 2 as  there is only one predicate node so C.C=P+1=2
Answer:

Related questions

13 votes
13 votes
3 answers
4
Kathleen asked Sep 22, 2014
12,351 views
A common property of logic programming languages and functional languages is:both are procedural languages both are based on $\lambda$-calculusboth are declarativeboth us...