Subjects in this paper

GATE CS 2019 CS questions

Q1

Verbal AptitudeMCQ1 mark−1/3 if wrong
The expenditure on the project __________ as follows: equipment Rs.20 lakhs, salaries Rs.12 lakhs, and contingency Rs.3 lakhs.
Show answer without attempting

Answer: C

Q2

Verbal AptitudeMCQ1 mark−1/3 if wrong
The search engine's business model __________ around the fulcrum of trust.
Show answer without attempting

Answer: A

Q3

Quantitative AptitudeMCQ1 mark−1/3 if wrong
Two cars start at the same time from the same location and go in the same direction. The speed of the first car is 50 km/h50\text{ km/h} and the speed of the second car is 60 km/h60\text{ km/h}. The number of hours it takes for the distance between the two cars to be 20 km20\text{ km} is __________.
Show answer without attempting

Answer: B

Q4

Quantitative AptitudeMCQ1 mark−1/3 if wrong
Ten friends planned to share equally the cost of buying a gift for their teacher. When two of them decided not to contribute, each of the other friends had to pay Rs 150150 more. The cost of the gift was Rs. __________.
Show answer without attempting

Answer: C

Q5

Analytical AptitudeMCQ1 mark−1/3 if wrong
A court is to a judge as __________ is to a teacher.
Show answer without attempting

Answer: D

Q6

Analytical AptitudeMCQ2 marks−2/3 if wrong
The police arrested four criminals -- P, Q, R and S. The criminals knew each other. They made the following statements:
P says "Q committed the crime."
Q says "S committed the crime."
R says "I did not do it."
S says "What Q said about me is false."
Assume only one of the arrested four committed the crime and only one of the statements made above is true. Who committed the crime?
Show answer without attempting

Answer: B

Q7

Quantitative AptitudeMCQ2 marks−2/3 if wrong
In the given diagram, teachers are represented in the triangle, researchers in the circle and administrators in the rectangle. Out of the total number of the people, the percentage of administrators shall be in the range of __________.
Question figure
Show answer without attempting

Answer: C

Q8

Verbal AptitudeMCQ2 marks−2/3 if wrong
"A recent High Court judgement has sought to dispel the idea of begging as a disease --- which leads to its stigmatization and criminalization --- and to regard it as a symptom. The underlying disease is the failure of the state to protect citizens who fall through the social security net."

Which one of the following statements can be inferred from the given passage?
Show answer without attempting

Answer: B

Q9

Quantitative AptitudeMCQ2 marks−2/3 if wrong
In a college, there are three student clubs. Sixty students are only in the Drama club, 8080 students are only in the Dance club, 3030 students are only in the Maths club, 4040 students are in both Drama and Dance clubs, 1212 students are in both Dance and Maths clubs, 77 students are in both Drama and Maths clubs, and 22 students are in all the clubs. If 75%75\% of the students in the college are not in any of these clubs, then the total number of students in the college is __________.
Show answer without attempting

Answer: C

Q10

Spatial AptitudeMCQ2 marks−2/3 if wrong
Three of the five students allocated to a hostel put in special requests to the warden. Given the floor plan of the vacant rooms, select the allocation plan that will accommodate all their requests.
Request by X: Due to pollen allergy, I want to avoid a wing next to the garden.
Request by Y: I want to live as far from the washrooms as possible, since I am very sensitive to smell.
Request by Z: I believe in Vaastu and so want to stay in the South-west wing.
The shaded rooms are already occupied. WR is washroom.
Show answer without attempting

Answer: D

Q1

Memory HierarchyMCQ1 mark−1/3 if wrong
A certain processor uses a fully associative cache of size 16 kB16\text{ kB}. The cache block size is 1616 bytes. Assume that the main memory is byte addressable and uses a 32-bit address. How many bits are required for the Tag and the Index fields respectively in the addresses generated by the processor?
Show answer without attempting

Answer: D

Q2

Memory HierarchyMCQ1 mark−1/3 if wrong
The chip select logic for a certain DRAM chip in a memory system design is shown below. Assume that the memory system has 16 address lines denoted by A15A_{15} to A0A_0. What is the range of addresses (in hexadecimal) of the memory system that can get enabled by the chip select (CS) signal?
Question figure
Show answer without attempting

Answer: A

Q3

ParsingMCQ1 mark−1/3 if wrong
Which one of the following kinds of derivation is used by LR parsers?
Show answer without attempting

Answer: D

Q4

Number Representation and ArithmeticMCQ1 mark−1/3 if wrong
In 16-bit 2's complement representation, the decimal number −28-28 is:
Show answer without attempting

Answer: C

Q5

Discrete MathematicsMCQ1 mark−1/3 if wrong
Let U={1,2,...,n}U = \{1, 2, ..., n\}. Let A={(x,X)∣x∈X,X⊆U}A = \{(x, X) \mid x \in X, X \subseteq U\}. Consider the following two statements on ∣A∣|A|.
I. ∣A∣=n2n−1\quad |A| = n 2^{n-1}
II. ∣A∣=∑k=1nk(nk)\quad |A| = \sum_{k=1}^n k \binom{n}{k}
Which of the above statements is/are TRUE?
Show answer without attempting

Answer: C

Q6

Boolean Algebra and MinimizationMCQ1 mark−1/3 if wrong
Which one of the following is NOT a valid identity?
Show answer without attempting

Answer: B

Q7

Regular LanguagesMCQ1 mark−1/3 if wrong
If LL is a regular language over Σ={a,b}\Sigma = \{a, b\}, which one of the following languages is NOT regular?
Show answer without attempting

Answer: B

Q8

Number Representation and ArithmeticMCQ1 mark−1/3 if wrong
Consider Z=X−YZ = X - Y, where X,YX, Y and ZZ are all in sign-magnitude form. XX and YY are each represented in nn bits. To avoid overflow, the representation of ZZ would require a minimum of:
Show answer without attempting

Answer: C

Q9

Linear AlgebraMCQ1 mark−1/3 if wrong
Let XX be a square matrix. Consider the following two statements on XX.
I. X\quad X is invertible.
II. \quad Determinant of XX is non-zero.

Which one of the following is TRUE?
Show answer without attempting

Answer: D

Q10

Discrete MathematicsMCQ1 mark−1/3 if wrong
Let GG be an arbitrary group. Consider the following relations on GG:
R1:∀a,b∈GR_1: \forall a, b \in G, a  R1  ba \; R_1 \; b if and only if ∃g∈G\exists g \in G such that a=g−1bga = g^{-1}bg
R2:∀a,b∈GR_2: \forall a, b \in G, a  R2  ba \; R_2 \; b if and only if a=b−1a = b^{-1}

Which of the above is/are equivalence relation/relations?
Show answer without attempting

Answer: B

Q11

TransactionsMCQ1 mark−1/3 if wrong
Consider the following two statements about database transaction schedules:
I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas' Write Rule can generate view serializable schedules that are not conflict serializable.

Which of the above statements is/are TRUE?
Show answer without attempting

Answer: C

Q12

Discrete MathematicsMCQ1 mark−1/3 if wrong
Let GG be an undirected complete graph on nn vertices, where n>2n > 2. Then, the number of different Hamiltonian cycles in GG is equal to
Show answer without attempting

Answer: C OR D

Q13

CalculusMCQ1 mark−1/3 if wrong
Compute lim⁡x→3x4−812x2−5x−3\lim_{x \to 3} \frac{x^4-81}{2x^2-5x-3}
Show answer without attempting

Answer: C

Q14

Storage and IndexingMCQ1 mark−1/3 if wrong
Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?
Show answer without attempting

Answer: B

Q15

Regular LanguagesMCQ1 mark−1/3 if wrong
For Σ={a,b}\Sigma = \{a, b\}, let us consider the regular language L={x∣x=a2+3k or x=b10+12k,k≥0}L = \{x \mid x = a^{2+3k} \text{ or } x = b^{10+12k}, k \ge 0\}. Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for LL?
Show answer without attempting

Answer: D

Q16

Application LayerMCQ1 mark−1/3 if wrong
Which of the following protocol pairs can be used to send and retrieve e-mails (in that order)?
Show answer without attempting

Answer: B

Q17

Processes and ThreadsNAT1 mark
The following C program is executed on a Unix/Linux system:
#include <unistd.h>
int main()
{
    int i;
    for (i=0; i<10; i++)
        if (i%2 == 0) fork();
    return 0;
}
The total number of child processes created is __________.
Show answer without attempting

Answer: 31

Q18

C ProgrammingNAT1 mark
Consider the following C program:
#include <stdio.h>
int jumble(int x, int y){
    x = 2*x + y;
    return x;
}
int main(){
    int x=2, y=5;
    y = jumble(y,x);
    x = jumble(y,x);
    printf("%d \n", x);
    return 0;
}
The value printed by the program is __________.
Show answer without attempting

Answer: 26

Q19

ParsingNAT1 mark
Consider the grammar given below:
S→AaS \to Aa
A→BDA \to BD
B→b∣ϵB \to b \mid \epsilon
D→d∣ϵD \to d \mid \epsilon

Let a,b,d,a, b, d, and $\$ be indexed as follows:
abd$\$
3210
Compute the FOLLOW set of the non-terminal BB and write the index values for the symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set is {a,b,d,$}\{a, b, d, \$\}, then the answer should be 3210)
Answer: __________.
Show answer without attempting

Answer: 31

Q20

Algorithm DesignNAT1 mark
An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is __________.
Show answer without attempting

Answer: 0.08

Q21

Discrete MathematicsNAT1 mark
The value of 351 mod 53^{51} \bmod 5 is __________.
Show answer without attempting

Answer: 2

Q22

Probability and StatisticsNAT1 mark
Two numbers are chosen independently and uniformly at random from the set {1,2,...,13}\{1, 2, ..., 13\}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations have the same most significant bit is __________.
Show answer without attempting

Answer: 0.502 to 0.504

Q23

Concurrency and SynchronizationNAT1 mark
Consider three concurrent processes P1, P2 and P3 as shown below, which access a shared variable D that has been initialized to 100.
P1P2P3
⋮\vdots⋮\vdots⋮\vdots
D=D+20\text{D} = \text{D} + 20D=D−50\text{D} = \text{D} - 50D=D+10\text{D} = \text{D} + 10
⋮\vdots⋮\vdots⋮\vdots
The processes are executed on a uniprocessor system running a time-shared operating system. If the minimum and maximum possible values of D after the three processes have completed execution are X and Y respectively, then the value of Y−XY - X is __________.
Show answer without attempting

Answer: 80

Q24

C ProgrammingNAT1 mark
Consider the following C program:
#include <stdio.h>
int main(){
    int arr[]={1,2,3,4,5,6,7,8,9,0,1,2,5}, *ip=arr+4;
    printf("%d\n", ip[1]);
    return 0;
}
The number that will be displayed on execution of the program is __________.
Show answer without attempting

Answer: 6

Q25

Algorithm DesignNAT1 mark
Consider a sequence of 14 elements: A=[−5,−10,6,3,−1,−2,13,4,−9,−1,4,12,−3,0]A = [-5, -10, 6, 3, -1, -2, 13, 4, -9, -1, 4, 12, -3, 0].
The subsequence sum S(i,j)=∑k=ijA[k]S(i, j) = \sum_{k=i}^j A[k]. Determine the maximum of S(i,j)S(i, j), where 0≤i≤j<140 \le i \le j < 14. (Divide and conquer approach may be used.)

Answer: __________.
Show answer without attempting

Answer: 29

Q26

RecursionMCQ2 marks−2/3 if wrong
Consider the following C function:
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?
Show answer without attempting

Answer: D

Q27

C ProgrammingMCQ2 marks−2/3 if wrong
Consider the following C program:
#include <stdio.h>
int r(){
    static int 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?
Show answer without attempting

Answer: B

Q28

IPv4MCQ2 marks−2/3 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?
Show answer without attempting

Answer: C

Q29

IPv4MCQ2 marks−2/3 if wrong
Suppose that in an IP-over-Ethernet network, a machine X wishes to find the MAC address of another machine Y in its subnet. Which one of the following techniques can be used for this?
Show answer without attempting

Answer: C

Q30

Combinational CircuitsMCQ2 marks−2/3 if wrong
Consider three 4-variable functions f1,f2f_1, f_2, and f3f_3, which are expressed in sum-of-minterms as
f1=∑(0,2,5,8,14)f_1 = \sum(0, 2, 5, 8, 14), f2=∑(2,3,6,8,14,15)\quad f_2 = \sum(2, 3, 6, 8, 14, 15), f3=∑(2,7,11,14)\quad f_3 = \sum(2, 7, 11, 14)
For the following circuit with one AND gate and one XOR gate, the output function f can be expressed as:
Question figure
Show answer without attempting

Answer: A

Q31

Context Free LanguagesMCQ2 marks−2/3 if wrong
Which one of the following languages over Σ={a,b}\Sigma = \{a, b\} is NOT context-free?
Show answer without attempting

Answer: C

Q32

Relational DesignMCQ2 marks−2/3 if wrong
Let the set of functional dependencies F={QR→S,R→P,S→Q}F = \{QR \to S, R \to P, S \to Q\} hold on a relation schema X=(PQRS)X = (PQRS). XX is not in BCNF. Suppose XX is decomposed into two schemas YY and ZZ, where Y=(PR)Y = (PR) and Z=(QRS)Z = (QRS).

Consider the two statements given below.
I. \quad Both YY and ZZ are in BCNF
II. \quad Decomposition of XX into YY and ZZ is dependency preserving and lossless

Which of the above statements is/are correct?
Show answer without attempting

Answer: C

Q33

Memory ManagementMCQ2 marks−2/3 if wrong
Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8 kB8\text{ kB} and the word size is 44 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?
Show answer without attempting

Answer: B

Q34

Discrete MathematicsMCQ2 marks−2/3 if wrong
Consider the following sets:
S1. Set of all recursively enumerable languages over the alphabet {0,1}\{0, 1\}
S2. Set of all syntactically valid C programs
S3. Set of all languages over the alphabet {0,1}\{0, 1\}
S4. Set of all non-regular languages over the alphabet {0,1}\{0, 1\}

Which of the above sets are uncountable?
Show answer without attempting

Answer: B

Q35

Discrete MathematicsMCQ2 marks−2/3 if wrong
Consider the first order predicate formula φ\varphi:
∀x [(∀z z∣x  ⟹  ((z=x)∨(z=1)))  ⟹  ∃w (w>x)∧(∀z z∣w  ⟹  ((w=z)∨(z=1)))]\forall x \, [(\forall z \, z \mid x \implies ((z = x) \lor (z = 1))) \implies \exists w \, (w > x) \land (\forall z \, z \mid w \implies ((w = z) \lor (z = 1)))]
Here 'a∣ba \mid b' denotes 'aa divides bb', where aa and bb are integers. Consider the following sets:
S1. {1,2,3,...,100}\{1, 2, 3, ..., 100\}
S2. Set of all positive integers
S3. Set of all integers

Which of the above sets satisfy φ\varphi?
Show answer without attempting

Answer: C

Q36

Syntax Directed TranslationMCQ2 marks−2/3 if wrong
Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X1,X2,X3,X4,X5,X_1, X_2, X_3, X_4, X_5, and X6X_6 be the placeholders for the non-terminals D,T,LD, T, L or L1L_1 in the following table:
Production ruleSemantic action
D→T  LD \to T \; LX1.type=X2.typeX_1.\text{type} = X_2.\text{type}
T→intT \to \text{int}T.type=intT.\text{type} = \text{int}
T→floatT \to \text{float}T.type=floatT.\text{type} = \text{float}
L→L1,idL \to L_1, \text{id}X3.type=X4.typeX_3.\text{type} = X_4.\text{type}; addType(id.entry,X5.type)\text{addType}(\text{id.entry}, X_5.\text{type})
L→idL \to \text{id}addType(id.entry,X6.type)\text{addType}(\text{id.entry}, X_6.\text{type})
Which one of the following are the appropriate choices for X1,X2,X3X_1, X_2, X_3 and X4X_4?
Show answer without attempting

Answer: A

Q37

Searching Sorting and HashingMCQ2 marks−2/3 if wrong
There are nn unsorted arrays: A1,A2,...,AnA_1, A_2, ..., A_n. Assume that nn is odd. Each of A1,A2,...,AnA_1, A_2, ..., A_n contains nn distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing the median of the medians of A1,A2,...,AnA_1, A_2, ..., A_n is
Show answer without attempting

Answer: C

Q38

Graph AlgorithmsMCQ2 marks−2/3 if wrong
Let GG be any connected, weighted, undirected graph.

I. GG has a unique minimum spanning tree, if no two edges of GG have the same weight.
II. GG has a unique minimum spanning tree, if, for every cut of GG, there is a unique minimum-weight edge crossing the cut.

Which of the above two statements is/are TRUE?
Show answer without attempting

Answer: C

Q39

DeadlocksMCQ2 marks−2/3 if wrong
Consider the following snapshot of a system running nn concurrent processes. Process ii is holding XiX_i instances of a resource R, 1≤i≤n1 \le i \le n. Assume that all instances of R are currently in use. Further, for all ii, process ii can place a request for at most YiY_i additional instances of R while holding the XiX_i instances it already has. Of the nn processes, there are exactly two processes pp and qq such that Yp=Yq=0Y_p = Y_q = 0. Which one of the following conditions guarantees that no other process apart from pp and qq can complete execution?
Show answer without attempting

Answer: A

Q40

Tree Data StructuresMCQ2 marks−2/3 if wrong
Consider the following statements:
I. The smallest element in a max-heap is always at a leaf node
II. The second largest element in a max-heap is always a child of the root node
III. A max-heap can be constructed from a binary search tree in Θ(n)\Theta(n) time
IV. A binary search tree can be constructed from a max-heap in Θ(n)\Theta(n) time

Which of the above statements are TRUE?
Show answer without attempting

Answer: A

Q41

SchedulingNAT2 marks
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:
ProcessP1P2P3P4
Arrival time0134
CPU burst time313Z
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 11 millisecond, then the value of Z is __________.
Show answer without attempting

Answer: 2

Q42

File SystemsNAT2 marks
The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointers. The disk block size is 4 kB4\text{ kB}, and the disk block address is 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) __________ GB.
Show answer without attempting

Answer: 3.7 to 3.8 OR 4.0 to 4.1

Q43

ParsingNAT2 marks
Consider the augmented grammar given below:
S′→SS' \to S
S→(L)∣idS \to (L) \mid \text{id}
L→L,S∣SL \to L, S \mid S

Let I0=CLOSURE({[S′→∙S]})I_0 = \text{CLOSURE}(\{[S' \to \bullet S]\}). The number of items in the set GOTO(I0,()\text{GOTO}(I_0, \text{(}) is: __________.
Show answer without attempting

Answer: 5

Q44

Linear AlgebraNAT2 marks
Consider the following matrix:
R=[1248139271416641525125]R = \begin{bmatrix} 1 & 2 & 4 & 8 \\ 1 & 3 & 9 & 27 \\ 1 & 4 & 16 & 64 \\ 1 & 5 & 25 & 125 \end{bmatrix}
The absolute value of the product of Eigen values of RR is __________.
Show answer without attempting

Answer: 12

Q45

Memory HierarchyNAT2 marks
A certain processor deploys a single-level cache. The cache block size is 8 words and the word size is 4 bytes. The memory system uses a 60-MHz60\text{-MHz} clock. To service a cache miss, the memory controller first takes 1 cycle to accept the starting address of the block, it then takes 3 cycles to fetch all the eight words of the block, and finally transmits the words of the requested block at the rate of 1 word per cycle. The maximum bandwidth for the memory system when the program running on the processor issues a series of read operations is __________ ×106\times 10^6 bytes/sec.
Show answer without attempting

Answer: 160

Q46

Probability and StatisticsNAT2 marks
Let TT be a full binary tree with 8 leaves. (A full binary tree has every level full.) Suppose two leaves aa and bb of TT are chosen uniformly and independently at random. The expected value of the distance between aa and bb in TT (i.e., the number of edges in the unique path between aa and bb) is (rounded off to 2 decimal places) __________.
Show answer without attempting

Answer: 4.25

Q47

Probability and StatisticsNAT2 marks
Suppose YY is distributed uniformly in the open interval (1,6)(1, 6). The probability that the polynomial 3x2+6xY+3Y+63x^2 + 6xY + 3Y + 6 has only real roots is (rounded off to 1 decimal place) __________.
Show answer without attempting

Answer: 0.8

Q48

Regular LanguagesNAT2 marks
Let Σ\Sigma be the set of all bijections from {1,...,5}\{1, ..., 5\} to {1,...,5}\{1, ..., 5\}, where idid denotes the identity function, i.e. id(j)=j,∀jid(j) = j, \forall j. Let ∘\circ denote composition on functions. For a string x=x1x2⋯xn∈Σn,n≥0x = x_1 x_2 \cdots x_n \in \Sigma^n, n \ge 0, let π(x)=x1∘x2∘⋯∘xn\pi(x) = x_1 \circ x_2 \circ \cdots \circ x_n.
Consider the language L={x∈Σ∗∣π(x)=id}L = \{x \in \Sigma^* \mid \pi(x) = id\}. The minimum number of states in any DFA accepting LL is __________.
Show answer without attempting

Answer: 120

Q49

Data Link LayerNAT2 marks
Consider that 15 machines need to be connected in a LAN using 8-port Ethernet switches. Assume that these switches do not have any separate uplink ports. The minimum number of switches needed is __________.
Show answer without attempting

Answer: 3

Q50

Combinational CircuitsNAT2 marks
What is the minimum number of 2-input NOR gates required to implement a 4-variable function expressed in sum-of-minterms form as f=∑(0,2,5,7,8,10,13,15)f = \sum(0, 2, 5, 7, 8, 10, 13, 15)? Assume that all the inputs and their complements are available. Answer: __________.
Show answer without attempting

Answer: 3

Q51

Relational QueriesNAT2 marks
A relational database contains two tables Student and Performance as shown below:

Student
Roll_no.Student_name
1Amit
2Priya
3Vinit
4Rohan
5Smita
Performance
Roll_no.Subject_codeMarks
1A86
1B95
1C90
2A89
2C92
3C80
The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together form 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 __________.
Show answer without attempting

Answer: 5

Q52

C ProgrammingNAT2 marks
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 the variable sum will be printed, when the above program is executed, is __________.
Show answer without attempting

Answer: 5

Q53

C ProgrammingNAT2 marks
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 the above C program is __________.
Show answer without attempting

Answer: 10

Q54

Discrete MathematicsNAT2 marks
In an RSA cryptosystem, the value of the public modulus parameter nn is 30073007. If it is also known that ϕ(n)=2880\phi(n) = 2880, where ϕ\phi denotes Euler's Totient Function, then the prime factor of nn which is greater than 5050 is __________.
Show answer without attempting

Answer: 97

Q55

Relational QueriesNAT2 marks
Consider the following relations P(X, Y, Z), Q(X, Y, T) and R(Y, V).

P
XYZ
X1Y1Z1
X1Y1Z2
X2Y2Z2
X2Y4Z4
Q
XYT
X2Y12
X1Y25
X1Y16
X3Y31
R
YV
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 \land R.V = V2)}(P \times R)\right) - \prod_X \left(\sigma_{(Q.Y = R.Y \land Q.T > 2)}(Q \times R)\right)
Answer: __________.
Show answer without attempting

Answer: 1

0/650 correct0 marks

More GATE CS papers