Time Left - 15:00 mins
GATE CS 2022 : Compiler design Quiz -5
Attempt now to get your rank among 276 students!
Question 1
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;
}
Question 2
Block Structures, procedures and recursion can be handled in compiler by a
Question 3
Compile Time stacks are not used for
Question 4
Which of the following information is not available in the activation record of a procedure?
Question 5
What is output by calling P in a language with static scope will be?
procedure P;
x: integer
procedure q;
begin
x = x + 1;
end;
procedure r;
x: integer;
begin x=5;
q;
write(x);
end;
begin //procedure starts here
x = 3;
r;
end;
Question 6
How many times the activation record of the functions will be pushed – poped onto the stack for the execution of the following program?
int main()
{
int n , b;
printf("Enter the number");
scanf("%d",&n);
b= A(n);
printf("%d",b);
return 0;
}
A(int n)
{
if(n==1)
return 1;
else
return 1+A(n/2);
}
Where the value of n is entered as 512
- 276 attempts
- 0 upvotes
- 0 comments
Oct 22GATE & PSU CS