Sie sind auf Seite 1von 2

Programming Languages

Quiz 2 (ODL)
Start Time: 8:00 AM End Time: 9:00 AM

Instruction:

1. You have to solve the quiz by hand.


2. Arrange all the question in order and upload the single pdf file with in due time containing the
information of your name, id and section i.e. XYX-100-D.
3. The readability of the questions must be clear.
4. In case of plagiarism and late submission, you will be award zero.

Question Description Marks CLO


No.
1 1. Differentiate the difference between keyword and reserved word, also mention 10 1
at least two programming languages that used them.
2. Explain why the l-value is required to access the r-value with the help of example.
3. Define static, stack-dynamic, explicit heap dynamic, implicit heap dynamic
variable with the help of example.
4. Provide solution for operand evaluation order and side effects problem.
5. Consider the following C program:
int fun(int *i)
{
*i +=3;
return 5;
}

void main ()
{
int x = 4;
x = x + fun(&x);
}

What is the value of x after the assignment in main, assuming


a) Operands are evaluated from right to left.
b) Operands are evaluated from right to left.

2 Describe the types of binding time and identify binding time type for the following 5 3
C++ instruction.
int result = square (5) ;
3 Consider the following JavaScript skeletal program 5 3

int main() {
var x;
function sub1()
{
var x;
var y;
function sub2()
{
var x;
var z;
}
function sub3()
{
var y,z;
. . . . . . . // < - - - - - - 1
}}}

a) Assume the dynamic scoping, in the following, which declaration of the x is


corrected one for a reference to x in function Sub3?
b) Indicate the reference environment variable at point 1 in sub3.

Das könnte Ihnen auch gefallen