Programming C MCQs Set-4

PropellerAds
  1. 1. What language has slogan ‘write once run anywhere’?
    • FORTRAN
    • LISP
    • JAVA
    • COBOL
    • C
  2. 2. How is Scheme opposite to Common Lisp?
    •  Scheme is large and complex; Common Lisp is small.
    • Common Lisp is not an ANSI standard; Scheme is.
    • Scheme is exclusively statically scoped; Common Lisp supports dynamic scoping.
    • Common Lisp is interpreted; Scheme is compiled.
  3. 3. Why must local variables in Lisp generally be allocated in the heap, rather than on the Stack
    • Because we don’t know their sizes at compile time.
    • Because local variables in Lisp have unlimited extent.
    • Because Lisp subroutines don’t follow strict LIFO calling conventions.
    • Because the Lisp garbage collector is unable to manipulate addresses in the stack.
  4. 4. through Q 38 refer to the following program in Scheme: (define add-n (lambda (n) (lambda (m) (+ m n)))) (let ((n 4) (f (add-n 3))) (+ n (f 2))) What does this program print?
    • 8
    •  9 
    • 10
    • none of the above
  5. 5. What would the program print if Scheme used dynamic scope and shallow binding?
    • 8
    •  9 
    • 10
    • none of the above
  6. 6. What would be the program print if scheme used dynamic scope and deep binding?
    • 8
    •  9 
    • 10
    • none of the above
  7. 7. The fact that the program contains two variables named n is an example of
    • Overloading
    • Aliasing
    • Both
    • neither
  8. 8. What would happen (in real scheme) if we reversed the order of the two definitions in the let block?
    • Nothing: the program would behave the same
    • The output would change,because f would capture a different n
    • The interpreter would complain that n is being used before it is declared
    • The interpreter would complain that the meaning of n is ambiguous
  9. 9. Which of the following is not an example of a high-level programming language?
    • Machine language
    • Assembly language
    • High level language
    • Natural language
  10. 10. Which of the following is not an example of a high-level programming language?
    • C++
    • PASCAL
    • Babbage 
    • BASIC