mcqs chapter 5 run time environment
TRANSCRIPT
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 1
Chapter 5: Run-Time Environment
1. Which of the following is drawback of static allocation strategy?
a. Size of the data objects must be known at compile time
b. data structures cannot be created dynamically
c. recursive procedure are restricted
d. all of the above
2. Which field is not present in activation record
a. saved machine status
b. register allocation
c. optional control link
d. temporaries
3. Which is not part of run time memory subdivision?
a. Stack
b. Heap
c. static data
d. access link
4. Which language necessarily need heap allocation in the run time
environment?
a. those that support recursion
b. those that use dynamic scoping
c. those that allow dynamic data structures
d. those that uses global variables
5. Which of the following expression have no l-value?
a. a[i+1]
b. a
c. 3
d. *a
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 2
6. The size field of activation record can be determined at
a. Run time
b. Compile time
c. Both a) and b)
d. None of the above
7. Which of the following symbol table implementation makes efficient use of
memory?
a. List
b. Search tree
c. Hash table
d. Self organising list
8. Dotted lines used in activation trees indicates
a. Execution of procedure is completed
b. Execution of procedure is not yet completed
c. Procedure is in execution
d. None of the above
9. Which of the following is needed to locate data needed by the called
procedure but found elsewhere?
a. Control link
b. Access link
c. Temporaries
d. Saved machine status
10. In which storage allocation strategy size is required at compiler time
a. Static allocation
b. Dynamic allocation
c. Stack Allocation
d. All
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 3
11. Which of the following are parameter passing method
a. Call by value
b. Call by reference
c. Call by restore
d. All
12. Which of the following fields are of activation record?
a. return value
b. local data
c. temporaries
d. All
13. If the called sub procedure doesn’t encounter any exception during its
execution then which of the two parameter passing mechanisms will
produce same result
a. call by value and call by reference
b. call by reference and call by value result
c. call by value and call by name
d. call by reference and call by name
14. A dangling reference is
a. pointer pointing to storage which is freed
b. pointer pointing to nothing
c. pointer pointing to storage which is still in use
d. pointer pointing to uninitialized storage
15. Which of the following are storage allocation strategies
a. Static allocation
b. Stack allocation
c. Heap Allocation
d. All
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 4
16. ________________ tree is used to depict the way control enters and leaves
activations
a. Activation tree
b. Tree
c. Parse tree
d. none of above
17. In activation tree each node represent
a. activation of main program
b. activation of a procedure
c. both a and b
d. none of above
18. In activation tree root represent
a. activation of main program
b. activation of a procedure
c. both a and b
d. none of above
19. The node for a is the parent of node for b if and only if
a. if lifetime of a occurs before lifetime of b
b. if control flows from activation of a to b
c. both a & b
d. none of above
20. The node for a is to the left of node for b if and only if
a. if lifetime of a occurs before lifetime of b
b. if control flows from activation of a to b
c. both a & b
d. none of above
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 5
21. Flow of control in a program corresponds to which traversal of activation
tree ?
a. Depth first traversal
b. Breadth first traversal
c. both a & b
d. none of above
22. _________________ can be used to keep track of live procedures
activations
a. Control stack
b. Activation tree
c. Activation node
d. none of above
23. If the occurrence of name in procedure is in the scope of declaration within
the procedure then it is said to be
a. local
b. nonlocal
c. global
d. none of above
24. In programming language semantics, which term maps the name to storage
location
a. Environment
b. State
c. both a & b
d. none of above
25. Subdivision of runtime memory consist of
a. code
b. static data
c. stack
d. All
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 6
26. Information needed by execution of a procedure is managed using a
contiguous block of storage called
a. Activation record
b. Frame
c. both a & b
d. activation tree
27. In activation record, optional control link points to
a. Activation record of caller
b. Activation record of callee
c. Both a & b
d. none of above
28. The field of actual parameter in activation record is used by which procedure
a. Calling procedure
b. Called procedure
c. both a & b
d. none
29. Allocation of an activation record and entering information into its field is
done by
a. return sequences
b. call sequence
c. both a & b
d. none of above
30. Consider an assignment statement like a[i]:= a[j].Then here a[i] represent
___________ and a[j] represent _______________.
a. value and storage location
b. storage location and value
c. value and value
d. none of above
Digital Technique Mrs. Sunita M Dol, CSE Dept
Walchand Institute of Technology, Solapur Page 7
31. By which parameter passing method operation on formal parameter does not
affect the value in the activation record of caller
a. Call by value
b. Call by reference
c. Call by name
d. none of above
32. Call by reference also called as
a. Call-by-address
b. Call-by-location
c. both a & b
d. none of above
33. A hybrid between call by value and call by reference is
a. copy-restore
b. copy-in copy-out
c. value-result
d. all of above
34. In which allocation ,names are bound to storage as program is compiled
a. static
b. heap
c. stack
d. none of above