Skip to content

Beta · Data may be lost.Your data may be reset or lost.

GateBrew
← GATE CSE 2015 Set 1
Questions

Q42

NAT2 marksMedium

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

Sign in to save attempts.

The solution is hidden while you attempt this question. It opens once you check or show the answer.