What is cyclomatic complexity of the above pseudo -code? 2

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
1Comment
shivani @shivani1234
17 Apr 2017 08:34 pm

First of all , Software Engineering is out of syllabus for GATE.

Secondly, cyclometric complexity for pseudo -code is calculated as :

cyclometric complexity =1+no. of decision points in the code.

Here as we can see, there are 3 decision points (condition checking statements) in pseudo code , i.e.

1.(m<n)
2.(x>y ) and 
3.(a<b) 

So, cyclometric complexity =1+3=4