GATE Computer Science (CS) 2015 Shift 1 Solved Paper

© examsiri.com
Question : 38 of 65
 
Marks: +1, -0
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) not Present = TRUE;

The cyclomatic complexity of the program segment is ________.
  • Your Answer:
Go to Question: