Q1
Show answer without attempting
Answer: B
GATE CS · 8 February 2015 · Slot 1 · 65 questions
Every question from the GATE CS 2015 CS-3 paper held on 8 February 2015, 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: B
Answer: B
Answer: C
Answer: B
Answer: C
Answer: A
Answer: B

Answer: 2006

Answer: B
Answer: B
#include <stdio.h>
int main()
{
char s1[7] = "1234", *p;
p = s1 + 2;
*p = '0';
printf("%s", s1);
}Answer: C
Answer: D
Answer: C
Answer: D
Answer: C
Answer: B
Answer: 612 to 613
Answer: B
Answer: A
Answer: C
Answer: 199
Answer: 80
Answer: B
Answer: C
Answer: 15
Answer: A
Answer: B
Answer: C
SELECT P1.address
FROM Cinema P1Answer: A
Answer: D
/* other code for process X */
while (true)
{
varP = true;
while (varQ == true)
{
/* Critical Section */
varP = false;
}
}
/* other code for process X *//* other code for process Y */
while (true)
{
varQ = true;
while (varP == true)
{
/* Critical Section */
varQ = false;
}
}
/* other code for process Y */Answer: A
Answer: B
Answer: 28
Answer: A
Answer: D
| 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | |
|---|---|---|---|---|---|---|---|---|---|---|
| 10 | 18 | 25 | 29 | 32 | 20 | 11 | 5 | 2 | 0 |
Answer: 308 to 310
Answer: B
void get(int n)
{
if (n<1) return;
get(n-1);
get(n-3);
printf("%d", n);
}get(6) function is being called in main() then how many times will the get() function be invoked before returning to the main()?Answer: B
Answer: 50
Answer: A
Answer: C
#include <stdio.h>
int f1(void);
int f2(void);
int f3(void);
int x = 10;
int main ( )
{
int x = 1;
x += f1() + f2() + f3() + f2();
printf("%d", x);
return 0;
}
int f1() { int x = 25; x++; return x;}
int f2() { static int x = 50; x++; return x;}
int f3() { x *= 10; return x;}Answer: 230
#include<stdio.h>
int main( )
{
static int a[ ] = {10, 20, 30, 40, 50};
static int *p[ ] = {a, a+3, a+4, a+1, a+2};
int **ptr = p;
ptr++;
printf("%d%d", ptr-p, **ptr);
}Answer: 140
Answer: B
Answer: D
Answer: 158
Answer: 8
| Time | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| X | X | ||||
| X | X | ||||
| X |
Answer: 3
Answer: B
//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[0][i];//initialize elements of Y to 0
//initialize elements X[i][j] of X to i+j
for(i = 0; i < n; i++)
Y[i] += X[i][0];Answer: C
| Time instance | T1 | T2 |
|---|---|---|
| 1 | read(A) | |
| 2 | write(A) | |
| 3 | read(C) | |
| 4 | write(C) | |
| 5 | read(B) | |
| 6 | write(B) | |
| 7 | read(A) | |
| 8 | commit | |
| 9 | read(B) |
Answer: B
Answer: C
#include<stdio.h>
int main( )
{
int i, j, k = 0;
j = 2 * 3 / 4 + 2.0 / 5 + 8 / 5;
k -= --j;
for(i = 0; i < 5; i++)
{
switch(i + k)
{
case 1:
case 2: printf("\n%d", i+k);
case 3: printf("\n%d", i+k);
default: printf("\n%d", i+k);
}
}
return 0;
}printf statement is executed is ____________.Answer: 10
Answer: A
Answer: 995
Answer: 1575
| Process | Arrival Time | Processing Time |
|---|---|---|
| A | 0 | 3 |
| B | 1 | 6 |
| C | 4 | 4 |
| D | 6 | 2 |
Answer: C
sumcal(int maxint, int value)
{
int result=0, i=0;
if (value < 0)
{
value = -value;
}
while((i<value) AND (result <= maxint))
{
i=i+1;
result = result + 1;
}
if (result <= maxint)
{
printf(result);
}
else
{
printf("large");
}
printf("end of program");
}
Answer: A
Answer: 5
Answer: C
Answer: 0.75
Answer: 3
DOSOMETHING(c, a, n)
z ← 1
for i ← 0 to k − 1
do z ← z² mod n
if c[i] = 1
then z ← (z × a) mod n
return zAnswer: 0
Answer: D
Answer: D
0/650 correct0 marks