Data-Communication
December 12, 2023
Software-Engineering
December 12, 2023
Data-Communication
December 12, 2023
Software-Engineering
December 12, 2023

ISRO CS 2014

Question 4
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?
A
2
B
3
C
4
D
5
Question 4 Explanation: 
Finding cyclomatic complexity using 3 formulas
1. E-V+2
2. P+1
3. No.of Regions
According to above code segment.
→ Edges-Vertices+2
= 8-6+2 = 4
→ Total number of regions = 4
→ Predicates+1 = 3+1 = 4
Note: We can use any one of above formulas.
Correct Answer: C
Question 4 Explanation: 
Finding cyclomatic complexity using 3 formulas
1. E-V+2
2. P+1
3. No.of Regions
According to above code segment.
→ Edges-Vertices+2
= 8-6+2 = 4
→ Total number of regions = 4
→ Predicates+1 = 3+1 = 4
Note: We can use any one of above formulas.

Leave a Reply

Your email address will not be published. Required fields are marked *