Time Left - 15:00 mins

GATE CS 2021 : Compiler Design Rapid Quiz-1 (App update required to attempt this test)

Attempt now to get your rank among 726 students!

Question 1

In the C program given below find the number of tokens present in it.
int main()
{
int l = 5, m= 4;
printf(“abbc ok : %d”, l*m);
printf(“GradeUp”);
return 0;
}

Question 2

How many of following statements are true?

1) Dynamic memory allocation is performed during runtime.

2) Type checking is performed at compile time

3) Inline expansion is performed during compile time

4) Symbol table management is performed during compile time

Question 3

If A->ɑ|ε is LL (1) and ɑ ε then which of the following is TRUE?

Question 4

Consider the following grammar for arithmetic expressions

X X+Z|Z

Z Z*Y|Y

Y (X)id

Then after eliminating the immediate left recursions we get

Question 5

Consider the syntax directed translation scheme(SDTS), with non-terminals {S,A} and {a,b}-

S -> bA {print 30}

S->b {print 20}

A-> Sa {print 10}

Using above SDTS, the output printed by bottom - up parser, for the input bba:-

Question 6

What is the output of following program?

// Parameters are passed by reference

main()

{

x = 10;

y = 5;

Fun(y,x);

Print(x);

Print(y);

}

Fun(a,b)

{

a= a - 5;

b = b + 10;

}

  • 726 attempts
  • 6 upvotes
  • 11 comments
Dec 14GATE & PSU CS