Skip to content
Official PYQ · 2015

GATE CS 2015 Set 1 Q42 — Software Engineering (Historical)

Explain with AI

Historical syllabus topic · This subject is outside the current GATE syllabus.

Consider the following C program segment.

while (first <= last)
{
    if (array[middle] < search)
        first = middle + 1; 
    else if (array[middle] == search)
        found = TRUE;
    else
        last = middle - 1;
    
    middle = (first + last)/2;
}

if (first > last)
    notpresent = TRUE;

The cyclomatic complexity of the program segment is_______________.

View answer

Answer: 5

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Software Engineering (Historical) questions