Consider the following C program segment. while(first <= last) { if…

PYQ GATE 2015

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 ________.

Attempted by 57 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…