Which of the following are true? (i) A programming language option does not permit global variables of any king and has no nesting of procedures

Trường Phan

New member
Which of the following are true?
(i) A programming language option does not permit global variables of any king and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation
(ii) Multi-level access link (or display) arrangement is needed to arrange activation records-only if the programming language being implemented has nesting of procedures/function
(iii) Recursion in programming languages cannot be implemented with dynamic storage allocation
(iv) Nesting of procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records
(v) Languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records.
A. (ii) and (v) only
B. (i), (iii) and (iv) only
C. (i), (ii) and (v)
D. (ii), (iii) and (v) only
 
Answer: a
Explanation: I. Statement is false since global variables are required for recursions with static storage. This is due to unavailability of stack in static storage. II. This is true III. In dynamic allocation heap structure is used, so it is false. IV. False since recursion can be implemented. V. Statement is completely true. So only II & V are true.
 

Tìm kiếm

Back
Top