GATE Computer Science & IT 2017 — GATE 2017 · CS · Set 1
CS Set 1 · 65 of 65 questions publicly available
Sections: General Aptitude, Computer Science & IT
| Subject | 1 mark questions | 2 mark questions | Total marks |
|---|---|---|---|
| General Aptitude | 5 | 5 | 15 |
| Computer Science | 25 | 30 | 85 |
Question 1 · 1 mark Q3050
The statement is logically equivalent to which of the statements below?
I.
II.
III.
IV.
- A.
I only
- B.
I and IV only
- C.
II only
- D.
II and III only
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 2 · 1 mark Q3051
Consider the first-order logic sentence . Assuming non-empty logical domains, which of the sentences below are implied by ?
I.
II
III.
IV.
- A.
IV only
- B.
I and IV only
- C.
II only
- D.
II and III only
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 3 · 1 mark Q3052
Let be scalars, not all zero, such that , where are column vectors in .
Consider the set of linear equations
where and . The set of equations has
- A.
a unique solution at
wheredenotes a-dimensional vector of all 1. - B.
no solution
- C.
infinitely many solutions
- D.
finitely many solutions
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 4 · 1 mark Q3053
Consider the following functions from positive integers to real numbers:
The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 5 · 1 mark Q3054
Consider the following table:
P. Kruskal | i. Divide and Conquer |
Q. Quicksort | ii. Greedy |
R. Floyd–Warshall | iii. Dynamic Programming |
Match the algorithms to the design paradigms they are based on.
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 6 · 2 marks Q3055
Let be a binary search tree with nodes. The minimum and maximum possible heights of are:
Note: The height of a tree with a single node is .
- A.
4 and 15 respectively.
- B.
3 and 14 respectively.
- C.
4 and 14 respectively.
- D.
3 and 15 respectively.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 7 · 2 marks Q3056
The n-bit fixed-point representation of an unsigned real number uses bits for the fraction part. Let . The range of decimal values for in this representation is
- A.
- B.
- C.
0 to
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 8 · 2 marks Q3057
Consider the C code fragment given below.
typedef struct node {
int data;
node* next;
} node;
void join(node* m, node* n) {
node* p = n;
while(p->next != NULL) {
p = p->next;
}
p->next = m;
}
Assuming that m and n point to valid NULL-terminated linked lists, invocation of join will
- A.
append list m to the end of list n for all inputs.
- B.
either cause a null pointer dereference or append list m to the end of list n.
- C.
cause a null pointer dereference for all inputs.
- D.
append list n to the end of list m for all inputs.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 9 · 2 marks Q3058
When two 8-bit numbers and in 2's complement representation (with and as the least significant bits) are added using a ripple-carry adder, the sum bits obtained are and the carry bits are . An overflow is said to have occurred if
- A.
the carry bit
is 1 - B.
all the carry bits
are 1 - C.
is 1 - D.
is 1
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 10 · 2 marks Q3059
Consider the following context-free grammar over the alphabet with as the start symbol:
Which one of the following represents the language generated by the above grammar?
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 11 · 1 mark Q3060
Consider the C struct defined below:
struct data { int marks [100]; char grade; int cnumber; }; struct data student;The base address of student is available in register R1. The field student.grade can be accessed efficiently using:
- A.
Post-increment addressing mode, (R1)+
- B.
Pre-decrement addressing mode, -(R1)
- C.
Register direct addressing mode, R1
- D.
Index addressing mode, X(R1), where X is an offset represented in 2′s complement 16-bit representation
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 12 · 1 mark Q3061
Consider the following intermediate program in three address code
p = a - b
q = p * c
p = u * v
q = p + q
Which one of the following corresponds to a static single assignment form of the above code?
- A.
p1 = a - b
q1 = p1 * c
p1 = u * v
q1 = p1 + q1
- B.
p3 = a - b
q4 = p3 * c
p4 = u * v
q5 = p4 + q4 - C.
p1 = a - b
q1 = p2 * c
p3 = u * v
q2 = p4 + q3 - D.
p1 = a - b
q1 = p * c
p2 = u * v
q2 = p + q
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 13 · 1 mark Q3062
Consider the following C code:
#include<stdio.h> int *assignval (int *x, int val) { *x = val; return x; } void main () { int *x = malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,0); if (x) { x = (int *)malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,10); } printf("%d\n", *x); free(x); }The code suffers from which one of the following problems:
- A.
compiler error as the return of malloc is not typecast appropriately.
- B.
compiler error because the comparison should be made as x == NULL and not as shown.
- C.
compiles successfully but execution may result in dangling pointer.
- D.
compiles successfully but execution may result in memory leak.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 14 · 1 mark Q3063
Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the server-side TCP?
- A.
LAST-ACK
- B.
TIME-WAIT
- C.
FIN-WAIT-1
- D.
FIN-WAIT-2
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 15 · 1 mark Q3064
A sender sends a message to receiver , which is digitally signed by with its private key. In this scenario, one or more of the following security violations can take place.
(I) can launch a birthday attack to replace with a fraudulent message.
(II) third party attacker can launch a birthday attack to replace with a fraudulent message.
(III) can launch a birthday attack to replace with a fraudulent message.
Which of the following are possible security violations?
- A.
I and II only
- B.
I only
- C.
II only
- D.
II and III only
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 16 · 1 mark Q2044
The following functional dependencies hold true for the relational schema {V, W, X, Y, Z}:
V → W
VW → X
Y → VX
Y → Z
Which of the following is irreducible equivalent for this set of functional dependencies?
- A.

- B.

- C.

- D.

Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 17 · 1 mark Q3066
Consider the following grammar:
p → xQRS
Q → yz | z
R → w | ε
S → y
What is FOLLOW()?
- A.
- B.
- C.
- D.
{w,$}
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 18 · 1 mark Q1835
Threads of a process share
- A.
global variables but not heap
- B.
heap but not global variables
- C.
neither global variables nor heap
- D.
both heap and global variables
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 19 · 1 mark Q3068
Let be a Gaussian random variable with mean 0 and variance . Let = max(,0) where max() is the maximum of and . The median of is ______________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 0
Question 20 · 1 mark Q3069
Let be a tree with 10 vertices. The sum of the degrees of all the vertices in is ________
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 18
Question 21 · 1 mark Q3070
Consider the Karnaugh map given below, where represents "don't care" and blank represents 0.

Assume for all inputs , the respective complements are also available. The above logic is implemented using 2-input NOR gates only. The minimum number of gates required is ____________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 1 gates
Question 22 · 1 mark Q3071
Consider the language given by the regular expression over the alphabet . The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting is ___________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 4
Question 23 · 1 mark Q3072
Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below:

SELECT AVG(EC.Num) FROM EC WHERE (DeptName, Num) IN (SELECT DeptName, COUNT(EmpId) AS EC(DeptName, Num) FROM EMP GROUP BY DeptName)
The output of executing the SQL query is _____________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 2.6
Question 24 · 1 mark Q1876
Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:
Process | Arrival Time | Burst Time |
P1 | 0 | 7 |
P2 | 3 | 3 |
P3 | 5 | 5 |
P4 | 6 | 2 |
If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _______ milliseconds.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 3 milliseconds
Question 25 · 1 mark Q3074
Consider a two-level cache hierarchy with L1 and L2 caches. An application incurs 1.4 memory accesses per instruction on average. For this application, the miss rate of L1 cache is 0.1; the L2 cache experiences, on average, 7 misses per 1000 instructions. The miss rate of L2 expressed correct to two decimal places is ________.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 0.05 fraction
Question 26 · 1 mark Q3075
Let be connected, undirected, edge-weighted graph. The weights of the edges in are positive and distinct. Consider the following statements:
(I) Minimum Spanning Tree of is always unique.
(II) Shortest path between any two vertices of is always unique.
Which of the above statements is/are necessarily true?
- A.
I only
- B.
II only
- C.
both I and II
- D.
neither I nor II
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 27 · 1 mark Q3076
A multithreaded program executes with number of threads and uses number of locks for ensuring mutual exclusion while operating on shared memory locations. All locks in the program are non-reentrant, i.e., if a thread holds a lock , then it cannot re-acquire lock without releasing it. If a thread is unable to acquire a lock, it blocks until the lock becomes available. The minimum value of and the minimum value of together for which execution of can result in a deadlock are:
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 28 · 1 mark Q3077
The value of
- A.
is 0
- B.
is -1
- C.
is 1
- D.
does not exist
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 29 · 1 mark Q3078
Let and be propositions and the expression be a contradiction. Then, the expression is
- A.
a tautology
- B.
a contradiction
- C.
always TRUE when
is FALSE - D.
always TRUE when
is TRUE
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 30 · 1 mark Q3079
Let and be two vectors in whose Euclidean norms satisfy ‖‖=2‖‖. What is the value of such that bisects the angle between and ?
- A.
2
- B.
1/2
- C.
1
- D.
-1/2
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 31 · 1 mark Q3080
Let be real valued square symmetric matrix of rank 2 with . Consider the following statements.
I. One eigenvalue must be in [−5,5]
II. The eigenvalue with the largest magnitude must be strictly greater than 5
Which of the above statements about eigenvalues of is/are necessarily CORRECT?
- A.
Both I and II
- B.
I only
- C.
II only
- D.
Neither I nor II
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 32 · 1 mark Q3081
A computer network uses polynomials over for error checking with 8 bits as information bits and uses as the generator polynomial to generate the check bits. In this network, the message 01011011 is transmitted as:
- A. 01011011010
- B. 01011011011
- C. 01011011101
- D. 01011011100
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 33 · 1 mark Q3082
Consider a combination of T and D flip-flops connected as shown below. The output of the D flip-flop is connected to the input of the T flip-flop and the output of the T flip-flop is connected to the input of the D flip-flop.

Initially, both Q0 and Q1 are set to 1 (before the 1st clock cycle). The outputs
- A.
Q1Q0 after the 3rd cycle are 11 and after the 4th cycle are 00 respectively.
- B.
Q1Q0 after the 3rd cycle are 11 and after the 4th cycle are 01 respectively.
- C.
Q1Q0 after the 3rd cycle are 00 and after the 4th cycle are 11 respectively.
- D.
Q1Q0 after the 3rd cycle are 01 and after the 4th cycle are 01 respectively.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 34 · 1 mark Q3083
If is a grammar with productions
where is the start variable, then which one of the following strings is not generated by ?
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 35 · 1 mark Q3084
Consider the following two functions.

The output printed when fun1(5) is called is
- A.
53423122233445
- B.
53423120112233
- C.
53423122132435
- D.
53423120213243
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 36 · 2 marks Q3085
Consider the C functions foo and bar given below:
int foo(int val) { int x=0; while(val > 0) { x = x + foo(val--); } return val; } int bar(int val) { int x = 0; while(val > 0) { x= x + bar(val-1); } return val; }Invocations of foo(3) and bar(3) will result in:
- A.
Return of 6 and 6 respectively.
- B.
Infinite loop and abnormal termination respectively.
- C.
Abnormal termination and infinite loop respectively.
- D.
Both terminating abnormally.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 37 · 2 marks Q3086
Consider the context-free grammars over the alphabet given below. and are non-terminals.
The language is
- A.
Finite
- B.
Not finite but regular
- C.
Context-Free but not regular
- D.
Recursive but not context-free
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 38 · 2 marks Q3087
Consider the following languages over the alphabet . Let and .
Which of the following are context-free languages?
I.
II.
- A.
I only
- B.
II only
- C.
I and II
- D.
Neither I nor II
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 39 · 2 marks Q3088
Let and be finite alphabets and let # be a symbol outside both and . Let be a total function from to . We say is computable if there exists a Turing machine which given an input ∈, always halts with on its tape. Let denote the language . Which of the following statements is true:
- A.
is computable if and only ifis recursive. - B.
is computable if and only ifis recursively enumerable. - C.
If
is computable thenis recursive, but not conversely. - D.
If
is computable thenis recursively enumerable, but not conversely.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 40 · 2 marks Q1899
Recall that Belady’s anomaly is that the page-fault rate may increase as the number of allocated frames increases. Now, consider the following statements:
S1: Random page replacement algorithm (where a page chosen at random is replaced) suffers from Belady’s anomaly
S2: LRU page replacement algorithm suffers from Belady’s anomaly
Which of the following is CORRECT?
- A.
S1 is true, S2 is true
- B.
S1 is true, S2 is false
- C.
S1 is false, S2 is true
- D.
S1 is false, S2 is false
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 41 · 2 marks Q3090
Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName, DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.
I. { | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∀v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}
II. { | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] ≠ v[DeptId]))}
III. { | ∃u ∈ EMP(t[EmpName] = u[EmpName] ∧ ∃v ∈ DEPT(t[DeptId] = v[DeptId]))}
Which of the above queries are safe?
- A.
I and II only
- B.
I and III only
- C.
II and III only
- D.
I, II and III
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 42 · 2 marks Q3091
In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock. Let and be the timestamps of transactions and respectively. Besides, holds a lock on the resource , and has requested a conflicting lock on the same resource . The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp.
if < then is killed
else waits.
Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?
- A.
The database system is both deadlock-free and starvation-free.
- B.
The database system is deadlock-free, but not starvation-free.
- C.
The database system is starvation-free, but not deadlock-free.
- D.
The database system is neither deadlock-free nor starvation-free.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 43 · 2 marks Q3092
Consider the following grammar:
stmt → if expr then expr else expr; stmt | Ò
expr → term relop term | term
term → id | number
id → a | b | c
number →[0−9]
where relop is a relational operator (e.g., <,>,…), Ò refers to the empty statement, and if, then, else are terminals.
Consider a program following the above grammar containing ten if terminals. The number of control flow paths in is________ . For example. the program
if e1then e2else e3
has 2 control flow paths. e1→e2 and e1→e3.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 1024
Question 44 · 2 marks Q3093
In a RSA cryptosystem, a participant A uses two prime numbers p = 13 and q = 17 to generate her public and private keys. If the public key of A is 35, then the private key of A is __________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 11
Question 45 · 2 marks Q3094
The values of parameters for the Stop-and-Wait ARQ protocol are as given below:
Bit rate of the transmission channel =1 Mbps.
Propagation delay from sender to receiver =0.75 ms.
Time to process a frame =0.25 ms.
Number of bytes in the information frame =1980.
Number of bytes in the acknowledge frame =20.
Number of overhead bytes in the information frame =20.
Assume there are no transmission errors. Then, the transmission efficiency (expressed in percentage) of the Stop-and-Wait ARQ protocol for the above parameters is _____________ (correct to 2 decimal places).
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 86.5 to 89.5
Question 46 · 2 marks Q3095
Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.
The following query is made on the database.
The number of rows in is ______________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 4
Question 47 · 2 marks Q3096
The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ____________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 271
Question 48 · 2 marks Q3097
Let be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index such that is 1 by probing the minimum number of locations in . The worst case number of probes performed by an optimal algorithm is ____________.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 5 probes
Question 49 · 2 marks Q3098
Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC-relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence
If the target of the branch instruction is , then the decimal value of the Offset is ____________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): -16 bytes
Question 50 · 2 marks Q3099
Instruction execution in a processor is divided into 5 stages, Instruction Fetch (IF), Instruction Decode (ID), Operand fetch (OF), Execute (EX), and Write Back (WB). These stages take 5, 4, 20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2 ns. Two pipelined implementation of the processor are contemplated:
I. a naive pipeline implementation (NP) with 5 stages and
II. an efficient pipeline (EP) where the OF stage is divided into stages OF1 and OF2 with execution times of 12 ns and 8 ns respectively.
The speedup (correct to two decimal places) achieved by EP over NP in executing 20 independent instructions with no hazards is _________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 1.5 to 1.51
Question 51 · 2 marks Q3100
Consider a 2-way set associative cache with 256 blocks and uses LRU replacement. Initially the cache is empty. Conflict misses are those misses which occur due to the contention of multiple blocks for the same cache set. Compulsory misses occur due to first time access to the block. The following sequence of access to memory blocks :
{0,128,256,128,0,128,256,128,1,129,257,129,1,129,257,129}
is repeated 10 times. The number of conflict misses experienced by the cache is _________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 76 misses
Question 52 · 2 marks Q3101
Consider the expression . Let be the minimum number of registers required by an optimal code generation (without any register spill) algorithm for a load/store architecture, in which
only load and store instructions can have memory operands and
arithmetic instructions can have only register or immediate operands.
The value of is _____________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 2
Question 53 · 2 marks Q3102
Consider the following C program.
#include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } void main() { char *x = "abc"; char *y = "defgh"; printlength(x,y); }
Recall that strlen is defined in string.ℎ as returning a value of type size_t, which is an unsigned int. The output of the program is __________ .
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 3
Question 54 · 2 marks Q3103
A cache memory unit with capacity of words and block size of words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is ____________ bits.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 14 bits
Question 55 · 2 marks Q3104
The output of executing the following C program is _______________ .
#include<stdio.h>
int total(int v) {
static int count = 0;
while(v) {
count += v&1;
v >>= 1;
}
return count;
}
void main() {
static int x=0;
int i=5;
for(; i>0; i--) {
x = x + total(i);
}
printf("%d\n", x);
}
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): 23
Question 56 · 2 marks Q3040
After Rajendra Chola returned from his voyage to Indonesia, he ________ to visit the temple in Thanjavur.
- A.
was wishing
- B.
is wishing
- C.
wished
- D.
had wished
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 57 · 2 marks Q3041
Research in the workplace reveals that people work for many reasons _______________ .
- A.
money beside
- B.
beside money
- C.
money besides
- D.
besides money
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 58 · 2 marks Q3042
Rahul, Murali, Srinivas and Arul are seated around a square table. Rahul is sitting to the left of Murali. Srinivas is sitting to the right of Arul. Which of the following pairs are seated opposite each other?
- A.
Rahul and Murali
- B.
Srinivas and Arul
- C.
Srinvas and Murali
- D.
Srinivas and Rahul
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 59 · 2 marks Q3043
Find the smallest number such that is a perfect cube.
- A.
24
- B.
27
- C.
32
- D.
36
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 60 · 2 marks Q3044
The probability that a -digit number does NOT contain the digits 0,5, or 9 is
- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C
Question 61 · 2 marks Q3045
"The hold of the nationalist imagination on our colonial past is such that anything inadequately or improperly nationalist is just not history."
Which of the following statements best reflects the author's opinion?
- A.
Nationalists are highly imaginative.
- B.
History is viewed through the filter of nationalism.
- C.
Our colonial past never happened.
- D.
Nationalism has to be both adequately and properly imagined.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 62 · 2 marks Q3046
Six people are seated around a circular table. There are at least two men and two women. There are at least three right-handed persons. Every woman has a left-handed person to her immediate right. None of the women are right-handed. The number of women at the table is
- A.
2
- B.
3
- C.
4
- D.
Cannot be determined
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): A
Question 63 · 2 marks Q3047
The expression is equal to :
- A.
The maximum of
and - B.
The minimum of
and - C.
1
- D.
None of the above
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): B
Question 64 · 2 marks Q3048
Arun, Gulab, Neel and Shweta must choose one shirt each from a pile of four shirts coloured red, pink, blue and white respectively. Arun dislikes the colour red and Shweta dislikes the colour white. Gulab and Neel like all the colours. In how many different ways can they choose the shirts so that no one has a shirt with a colour he or she dislikes?
- A.
21
- B.
18
- C.
16
- D.
14
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): D
Question 65 · 2 marks Q3049
A contour line joins locations having the same height above the mean sea level. The following is a contour plot of a geographical region. Contour lines are shown at 25 intervals in this plot. If in a flood, the water level rises to 525 , which of the villages get submerged?

- A.
- B.
- C.
- D.
Official answer key
Official answer key (GATE Computer Science & IT 2017 GATE 2017 · CS · Set 1): C