Complete GATE CSE 2017 Paper 1 overview, original pages and practice · Timed previous-paper practice

Questions 34–36 of 65. Imported answers require review unless explicitly marked reviewed.

Paper practice 65 questionsPage 12 of 22

Question 34

Open question
CSMCQ2 marksNeeds review
If

is a grammar with productions

where

is the start variable, then which one of the following strings is not generated by

?
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 35

Open question
CSMCQ2 marksNeeds review
Consider the following two functions.
void fun1(int n) {
if(n == 0) return;
printf("%d", n);
fun2(n - 2);
printf("%d", n);
}

void fun2(int n) {
if(n == 0) return;
printf("%d", n);
fun1(++n);
printf("%d", n);
}
The output printed when fun1(5) is called is
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer

Question 36

Open question
CSMCQ2 marksNeeds review
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:
Your answerChoose one option.

Log in to check the answer

You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer