GATE 2022 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2022

65 questions

MCQ 32 · MSQ 15 · NAT 181-mark 30 · 2-mark 35

Questions 41–45 of 65

Q41Number System2 marksMCQ−0.67 if wrong
Consider three floating point numbers A, B and C stored in registers RAR_A, RBR_B and RCR_C, respectively as per IEEE-754 single precision floating point format. The 32-bit content stored in these registers (in hexadecimal form) are as follows.

RA=0xC1400000R_A=0xC1400000
RB=0x42100000R_B=0x42100000
RC=0x41400000R_C=0x41400000

Which one of the following is FALSE?

Q42CPU Scheduling2 marksMCQ−0.67 if wrong
Consider four processes P, Q, R, and S scheduled on a CPU as per round robin algorithm with a time quantum of 4 units. The processes arrive in the order P, Q, R, S, all at time t = 0. There is exactly one context switch from S to Q, exactly one context switch from R to Q, and exactly two context switches from Q to R. There is no context switch from S to P. Switching to a ready process after the termination of another process is also considered a context switch. Which one of the following is NOT possible as CPU burst time (in time units) of these processes?

Q43Array and Pointer2 marksMCQ−0.67 if wrong
What is printed by the following ANSI C program?
#include <stdio.h>
int main(int argc, char *argv[])
{
 int a[3][3][3] =
 {{1, 2, 3, 4, 5, 6, 7, 8, 9},
 {10, 11, 12, 13, 14, 15, 16, 17, 18},
 {19, 20, 21, 22, 23, 24, 25, 26, 27}};
int i = 0, j = 0, k = 0; 
for( i = 0; i < 3; i++ ){

     for(k = 0; k < 3; k++ ) 
      printf("%d ", a[i][j][k]);
 printf(" \n");
}
return 0;
}

Q44Arithmetic Operation2 marksMCQ−0.67 if wrong
What is printed by the following ANSI C program?
#include <stdio.h>
int main(int argc, char *argv[]){ 
 char a = 'P';
 char b = 'x';
 char c = (a  &  b) + '*';
 char d = (a | b) - '-';
 char e = (a ^ b) + '+'; 
 printf("%c %c %c \n", c, d, e); 
 return 0;
}

ASCII encoding for relevant characters is given below
ABC...Z 656667...90 abc...z 979899...122 *+ 424345

Q45Numerical Solution of Algebraic Equations2 marksMCQ−0.67 if wrong
Consider solving the following system of simultaneous equations using LU decomposition.
x1+x2−2x3=4x1+3x2−x3=72x1+x2−5x3=7\begin{aligned} x_1+x_2-2x_3&=4 \\ x_1+3x_2-x_3&=7 \\ 2x_1+x_2-5x_3&=7 \end{aligned}
where L and U are denoted as
L=[L1100L21L220L31L32L33],U=[U11U12U130U22U2300U33]L= \begin{bmatrix} L_{11} & 0 & 0 \\ L_{21}& L_{22} & 0 \\ L_{31} & L_{32} & L_{33} \end{bmatrix}, U= \begin{bmatrix} U_{11} & U_{12} & U_{13} \\ 0& U_{22} & U_{23} \\ 0 & 0 & U_{33} \end{bmatrix}
Which one of the following is the correct combination of values for L32,U33,L32, U33, and x1x_1?