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

GATE 2019

65 questions

MCQ 41 · NAT 241-mark 30 · 2-mark 35

Questions 36–40 of 65

Q36Function2 marksMCQ−0.67 if wrong
Consider the following C program:

void convert(int n) {
  if (n<0)
    printf("%d",n);
  else {
    convert(n/2);
    printf("%d",n%2);
  }
}
Which one of the following will happen when the function convert is called with any positive integer n as argument?

Q37Function2 marksMCQ−0.67 if wrong
Consider the following C program:

#include <stdio.h>
int r(){
 int static num=7;
 return num--;
}
int main() {
 for(r();r();r()) {
  printf("%d ",r());
  };
 return 0;
}
Which one of the following values will be displayed on execution of the programs?

Q38Network Layer Protocol2 marksMCQ−0.67 if wrong
Consider three machines M, N and P with IP addresses 100.10.5.2, 100.10.5.5 and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?

Q40Boolean Algebra2 marksMCQ−0.67 if wrong
Consider three 4-variable functions f1,f2  and  f3f_1,f_2 \; and \; f_3, which are expressed in sum-of-minterms

f1=Σ(0,2,5,8,14)f_1=\Sigma (0,2,5,8,14)
f2=Σ(2,3,6,8,14,15)f_2=\Sigma (2,3,6,8,14,15)
f3=Σ(2,7,11,14)f_3=\Sigma (2,7,11,14)

For the following circuit with one AND gate and one XOR gate, the output function f can be expressed as:
f1 f2 f3 AND XOR f