retagged by
7,845 views
6 votes
6 votes

Consider the following pseudo- code

while (m<n)
    if (x>y ) and (a<b) then
        a=a+1
        y=y-1
    end if
m=m+1 end while

What is cyclomatic complexity of the above pseudo -code?

  1. 2
  2. 3
  3. 4
  4. 5
retagged by

3 Answers

Best answer
14 votes
14 votes

Cyclomatic complexity will be 8 - 6 +2 = 4

selected by
10 votes
10 votes

Answer is (B) part.

5 votes
5 votes

Cyclomatic complexity = no of predicate nodes +1

=3+1

One for while,  two for if bcoz of two conditions as if first condition then if second condition then do given. 

Answer:

Related questions

5 votes
5 votes
1 answer
1
go_editor asked Jul 1, 2016
3,305 views
For a software project, the spiral model was employed. When will the spiral stop?When the software product is retiredWhen the software product is released after Beta test...
4 votes
4 votes
2 answers
2
kvkumar asked Jun 29, 2016
3,699 views
Which of the following is not a maturity level as per Capability Maturity Model?InitialMeasurableRepeatableOptimized
0 votes
0 votes
1 answer
3
Ramayya asked Jan 7
255 views
McCabe’s cyclomatic complexity number of a program control graph ‘$G$’ with $e$edges, $n$ nodes and $p$ disconnected paths is defined as$n – e + 2p$$e – n + 2 +...
6 votes
6 votes
1 answer
4
makhdoom ghaya asked May 12, 2016
4,762 views
What is the cyclomatic complexity of a module which has seventeen edges and thirteen nodes?$4$$5$$6$$7$