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 61–65 of 65

Q61SQL2 marksNAT
A relational database contains two tables Student and Performance as shown below:
Student Roll_no. Student_name 1 Amit 2 Priya 3 Vinit 4 Rohan 5 Smita Performance Roll_no. Subject_code Marks 1 A 86 1 B 95 1 C 90 2 A 89 2 C 92 3 C 80
The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together from the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE  P.Marks  >  84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is _________ .

Q62Loop2 marksNAT
Consider the following C program:

#include <stdio.h>
int main() {
 float sum = 0.0, j = 1.0, i = 2.0;
 while (i / j > 0.0625) {
    j = j + j; 
    sum = sum + i/j;
    printf("%f \n", sum);
 }
 return 0;
}
The number of times variable sum will be printed When the above program is executed is _________ .

Q63Array and Pointer2 marksNAT
Consider the following C program:

#include <stdio.h>
int main() { 
  int a[] = {2, 4, 6, 8, 10}; 
  int i, sum = 0, *b = a + 4; 
  for (i = 0; i < 5; i++ ) 
  sum = sum + (*b - i) - *(b - i); 
  printf("%d\n", sum); 
  return 0; 
} 
The output of above C program is __________ . Note: This was Numerical Type question.

Q64Network Security2 marksNAT
In an RSA cryptosystem, the value of the public modulus parameter n is 3007. If it is also is known that ϕ(n)=2880\phi(n)=2880, where ϕ()\phi() denotes Euler's Totient Function, then the prime factors of n which is greater than 50 is _________ .

Q65Relational Algebra2 marksNAT
Consider the following relation P(X, Y, Z), Q(X, Y, T) and R(Y, V):
PQR XYZ XYT YV X1Y1Z1 X1Y1Z2 X2Y2Z2 X2Y4Z4 X2Y12 X1Y25 X1Y16 X3Y31 Y1V1 Y3V2 Y2V3 Y2V2
How many tuples will be returned by the following relational algebra query?
∏X(σ(P.Y=R.Y ∧ R.V=V2)(P×R))−∏X(σ(Q.Y=R.Y ∧ Q.T>2)(Q×R))\prod_{X}\left(\sigma_{(P.Y=R.Y\ \wedge\ R.V=\text{V2})}(P\times R)\right)-\prod_{X}\left(\sigma_{(Q.Y=R.Y\ \wedge\ Q.T\gt 2)}(Q\times R)\right)
Answer:______