Q1
Show answer without attempting
Answer: D
GATE CS · 6 February 2016 · Slot 1 · 65 questions
Every question from the GATE CS 2016 CS-1 paper held on 6 February 2016, in the order it was printed, with the official answer key. Pick an option, or type the number for numerical-answer questions, and it is marked straight away with GATE marking: 1 or 2 marks, −⅓ or −⅔ for a wrong MCQ, no negative marks for MSQ and NAT.
Answer: D
Answer: A
Answer: A
Answer: C
Answer: D
| Quarter \ Product | Elegance | Smooth | Soft | Executive |
|---|---|---|---|---|
| Q1 | 27300 | 20009 | 17602 | 9999 |
| Q2 | 25222 | 19392 | 18445 | 8942 |
| Q3 | 28976 | 22429 | 19544 | 10234 |
| Q4 | 21012 | 18229 | 16595 | 10109 |
Answer: B
Answer: D
Answer: D
Answer: B
Answer: B
Answer: 11.0
Answer: B
Answer: 1.0
Answer: 0.5
Answer: 15.0
Answer: A
Answer: -11.0
Answer: 3.0 to 4.0
Answer: 31.0
Answer: A

Answer: 6.0
void f(int, short);
void main()
{
int i = 100;
short s = 12;
short *p = &s;
__________ ; // call to f()
}Answer: D
Answer: D
Answer: A
#include<stdio.h>
void mystery(int *ptra, int *ptrb) {
int *temp;
temp = ptrb;
ptrb = ptra;
ptra = temp;
}
int main() {
int a=2016, b=0, c=4, d=42;
mystery(&a, &b);
if (a < c)
mystery(&c, &a);
mystery(&a, &d);
printf("%d\n", a);
}Answer: 2016.0
Answer: D
Answer: C
Answer: B
x = u - t;
y = x * v;
x = y + w;
y = t - z;
y = x * y;Answer: 10.0
Answer: A
Answer: B
Answer: D
Answer: B
Answer: C
Answer: C
Answer: 10.0
Answer: 197.9 to 198.1
Answer: 2.0
Answer: 0.33 to 0.34

Answer: D
Answer: 456.0
Answer: 33.0 to 34.0
Answer: B
int max(int *p, int n) {
int a=0, b=n-1;
while (__________) {
if (p[a] <= p[b]) { a = a+1; }
else { b = b-1; }
}
return p[a];
}Answer: D
void count(int n){
static int d=1;
printf("%d ", n);
printf("%d ", d);
d++;
if(n>1) count(n-1);
printf("%d ", d);
}
void main(){
count(3);
}Answer: A
a=3;
void n(x) {x = x * a; print(x);}
void m(y) {a = 1; a = y - a; n(a); print(a);}
void main() {m(a);}Answer: D
Answer: B
Answer: 12.0
Answer: 7.0
Answer: B
while Q is not Empty do
if S is Empty OR Top(S) <= Head(Q) then
x := Dequeue(Q);
Push(S,x);
else
x := Pop(S);
Enqueue(Q,x);
end
endAnswer: 256.0
Answer: D

Answer: D
Answer: C
| Operator | Precedence | Associativity | Arity |
|---|---|---|---|
| High | Left | Binary | |
| Medium | Right | Binary | |
| Low | Left | Binary |
Answer: 9.0
Answer: C
Answer: 384.0
Answer: 346.0
Answer: 1.0
do {
c[i]=1; t[i] = pmax(t[0],...,t[n-1])+1; c[i]=0;
for every j ≠ i in {0,...,n-1} {
while (c[j]);
while (t[j] != 0 && t[j]<=t[i]);
}
Critical Section;
t[i]=0;
Remainder Section;
} while (true);Answer: A
Answer: A
Answer: B
Answer: 13.0
Answer: 1.1
Answer: 2500.0
0/650 correct0 marks