• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Principles of Programming Languages

Question 31

Consider the following pseudo-code
x:=1;
i:=1;
while (x <= 1000)
begin
  x:=2^x;
  i:=i+1;
end;
What is the value of i at the end of the pseudo-code?
  • 4
  • 5
  • 6
  • 7

Question 32

Which of the following programming language(s) provides garbage collection automatically
  • Lisp
  • C++
  • Fortran
  • C

Question 33

The Operating System of a computer may periodically collect all the free memory space to form contiguous block of free space. This is called:
  • Concatenation
  • Garbage collection
  • Collision
  • Dynamic Memory Allocation

Question 34

Let P be a procedure that for some inputs calls itself (i.e. is recursive). If P is guaranteed to terminate, which of the following statement(s) must be true?
I.   P has a local variable
II.  P has an execution path where it does not call itself
III. P either refers to a global variable or has at least one parameter
  • I only
  • II only
  • III only
  • II and III only

Question 35

Which of the following statements is/are True? P : C programming language has a weak type system with static types. Q : Java programming language has a strong type system with static types. Code:
  • P only
  • Q only
  • Both P and Q
  • Neither P nor Q

There are 35 questions to complete.

Last Updated :
Take a part in the ongoing discussion