CS/IT Gate Yearwise
CS/IT Gate 2025 (Set 2)
CS/IT Gate 2024 (Set 1)
CS/IT Gate 2024 (Set 2)
CS/IT Gate 2023
CS/IT Gate 2022
CS/IT Gate 2021 (Set 1)
CS/IT Gate 2021 (Set 2)
CS/IT Gate 2020
CS/IT Gate 2019
CS/IT Gate 2018
CS/IT Gate 2017 (Set 1)
CS/IT Gate 2017 (Set 2)
CS/IT Gate 2016 (Set 1)
CS/IT Gate 2016 (Set 2)
CS/IT Gate 2015 (Set 1)
CS/IT Gate 2015 (Set 2)
CS/IT Gate 2015 (Set 3)
CS/IT Gate 2014 (Set 1)
CS/IT Gate 2014 (Set 2)
CS/IT Gate 2014 (Set 3)
CS and IT Gate 2015 Set-2 Questions with Answer
Ques 1 Gate 2015 Set-2
If p, q, r, s are distinct integers such that:
f(p, q, r, s) = max (p, q, r, s)
g(p, q, r, s) = min (p, q, r, s)
h(p, q, r, s) = remainder of (p × q) / (r × s) if (p × q) > (r × s) OR
remainder of (r × s) / (p × q) if (r × s) > (p × q)
Also a function fgh (p, q, r, s) =
f(p, q, r, s) × g(p, q, r, s) × h(p, q, r, s).
Also the same operation are valid with two variable functions
of the form f(p, q).
What is the value of fg(h(2, 5, 7, 3), 4, 6, 8)?
Given functions:
f(p, q, r, s) = max(p, q, r, s)
g(p, q, r, s) = min(p, q, r, s)
h(p, q, r, s) = remainder when larger product is divided by smaller product
We need to find: fg(h(2, 5, 7, 3), 4, 6, 8)
Let me start from the innermost function h(2, 5, 7, 3):
First, calculating the products:
p × q = 2 × 5 = 10
r × s = 7 × 3 = 21
Since (r × s) > (p × q), which means 21 > 10
h(2, 5, 7, 3) = remainder of 21 ÷ 10
h(2, 5, 7, 3) = 1
Now I need to find fg(1, 4, 6, 8):
Here fg means f × g (multiplication of f and g functions)
Calculating f(1, 4, 6, 8):
f(1, 4, 6, 8) = max(1, 4, 6, 8) = 8
Calculating g(1, 4, 6, 8):
g(1, 4, 6, 8) = min(1, 4, 6, 8) = 1
Therefore:
fg(1, 4, 6, 8) = f(1, 4, 6, 8) × g(1, 4, 6, 8)
fg(1, 4, 6, 8) = 8 × 1
fg(1, 4, 6, 8) = 8
Answer: fg(h(2, 5, 7, 3), 4, 6, 8) = 8
Ques 2 Gate 2015 Set-2
Out of the following four sentences, select the most suitable sentence with respect to grammar and usage
Ques 3 Gate 2015 Set-2
If the list of letters, P, R, S, T, U is an arithmetic sequence, which of the following are also in arithmetic sequence?
I. 2P, 2R, 2S, 2T, 2U
II. P–3, R–3, S–3, T–3, U–3
III. P2, R2, S2, T2, U2
Ques 4 Gate 2015 Set-2
Four branches of a company are located at M, N, O and P. M is north of N at a distance of 4 km; P is south of O at a distance of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?
Ques 5 Gate 2015 Set-2
A generic term that includes various items of clothing such as a skirt, a pair of trousers and a shirt is
Ques 6 Gate 2015 Set-2
Based on the given statements, select the most appropriate option to solve the given question. What will be the total weight of 10 poles each of same weight?
Statements:
(I) One fourth of the weight of a pole is 5 kg
(II) The total weight of these poles is 160 kg more
than the total weight of two poles.
Ques 7 Gate 2015 Set-2
Choose the statement where underlined word is used correctly.
Ques 8 Gate 2015 Set-2
We __________ our friend’s birthday and we ________ how to make it up to him.
Ques 9 Gate 2015 Set-2
Consider the following C function.
{
int x=1, k;
if (n==1) return x;
for (k=1; k < n; ++k)
x = x + fun(k) * fun(n – k);
return x;
}
The return value of fun(5) is __________.
Ques 10 Gate 2015 Set-2
Consider the following function written in the C programming language.
{
if (*a && *a != ` `)
{
foo(a+1);
putchar(*a);
}
}
The output of the above function on input “ABCD EFGH” is
Ques 11 Gate 2015 Set-2
In the context of abstract-syntax-tree (AST) and control-flow-graph (CFG), which one of the following is True?
Ques 12 GATE 2015 SET-2
Match the following:

Ques 13 GATE 2015 SET-2
Consider the intermediate code given below.
(1) i = 1
(2) j = 1
(3) t1 = 5 * i
(4) t2 = t1 + j
(5) t3 = 4 * t2
(6) t4 = t3
(7) a[t4] = -1
(8) j = j + 1
(9) if j ≤ 5 goto (3)
(10) i = i + 1
(11) if i < 5 goto (2)
The number of nodes and edges in the control-flow-graph constructed for the above code, respectively, are
Total Unique Visitors