aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programming and Data Structures - GATE Practice
  • Consider the following program Program P2 ![](https://i.i...
Multiple choice

Consider the following program Program P2

If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program?

  1. 10

  2. 11

  3. 3

  4. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

n = 10 given but not passed to D. In D, n = 3 & W(n) increments by 1. So n = n + 1 = 4.

Keep practicing — related questions

  • What is printed by the print statements in the program P1 assuming call by reference parameter passing? Pro...
  • The variables or expressions referenced in the parameter list of a subprogram call are Actual parameters?
  • The following program fragment is written in a programming language that allows global variables and does n...
  • The following program fragment is written in a programming language that allows global variables and does n...
  • What gets printed when the following program is compiled and run? class test { public static void main(Stri...
  • How can you determine the number of positional parameter passed to the script ?
  • The following program fragment is written in a programming language that allows global variables and does n...
  • The following program fragment is written in a programming language that allows global variables and does n...
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy