GATE 2026 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2026 (Session 2)

65 questions

MCQ 35 · MSQ 11 · NAT 191-mark 30 · 2-mark 35

Questions 61–65 of 65

Q61Function2 marksNAT
Consider the following ANSI-C function.
 int func(int start, int end){
  	int length=end+1-start;
  	if((length<1)||(start<0)||(end<0)){ return(0); }
  	if(length%3==0){
  		return(func(start+1, end));
  	}else if(length%3==1){
  		return(1+func(start, end-1));
  	}else {
  		return(func(start+2, end));
  	}
 } 
The maximum possible value that can be returned from this function is ________. (answer in integer)
Note: Ignore syntax errors (if any) in the function.

Q62Matrix Algebra2 marksNAT
The determinant of a 4×44 \times 4 matrix AA is 33. The value of the determinant of 2A2 A is ________. (answer in integer)

Q63Probability Theory2 marksNAT
Suppose an unbiased coin is tossed 66 times. Each coin toss is independent of all previous coin tosses. Let E1E_{1} be the event that among the second, fourth, and sixth coin tosses, there are at least two heads. Let E2E_{2} be the event that among the first, second, third, and fifth coin tosses, there are equal number of heads and tails.
The conditional probability P(E1∣E2){P}\left(E_{1} \mid E_{2}\right) is equal to ________ (rounded off to one decimal place)

Q64Discrete Mathematics2 marksNAT
Consider a function f:(0,1)→{0,1}f : (0,1) \rightarrow \{0,1\} defined as follows.

For a real number r∈(0,1)r \in (0,1), f(r)=1f(r) = 1 if the second digit after the decimal point in rr is one of the four digits 2,3,6,2, 3, 6, and 77. Otherwise, f(r)f(r) is equal to 00.

The number of points in (0,1)(0,1) at which ff is discontinuous is ______. (Answer in integer)