9 9 votes Consider the following program in a language that has dynamic scooping: var x: real; procedure show: begin print(x);end; procedure small; var x: real; begin x: = 0.125; show; end; begin x:=0.25 show; small end. Then the output of the program is: 0.125 0.125 0.25 0.25 0.25 0.125 0.125 0.25 Programming in C gate1999 programming variable-binding normal out-of-gatecse-syllabus + – Kathleen 8.5k views answer comment Share Follow Print See 1 comment 1 1 comment reply P0535_Yedidyah_Sagar commented Oct 3, 2025 reply Follow flag I think this is still in syllabus 1 1 replyShare Please log in or register to add a comment.
Best answer 24 24 votes ans c) In dynamic scoping, if a variable is not found in the local scope it is looked up on at the function from which the call is made. Aditi Dan answered Dec 19, 2014 • selected Dec 22, 2014 by Arjun Aditi Dan comment Share Follow See all 7 Comments 7 7 Comments reply Show 4 previous comments eyeamgj commented Sep 10, 2017 reply Follow flag finding outputs of procedural language is still in syllabus? 0 0 replyShare tonystark007 commented Sep 16, 2017 reply Follow flag Its answer should be option: "b: .25 .25" because x is also declared in procedure small hence scope of variable x = .125 will be limited to procedure small only. 0 0 replyShare hem chandra joshi commented Nov 16, 2017 reply Follow flag so if it would ask for static scope then c would be the answer ? @bikram sir 0 0 replyShare Please log in or register to add a comment.
11 11 votes .... Hira Thakur answered Nov 16, 2017 Hira Thakur comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Start from the Last Line. 1. x := 0.25 (global) 2. show() => prints global x = 0.25 3. small(): 4. Local x := 0.125 => show() = looks in small's scope => x = 0.125Output: 0.25 0.125 soudipta_dutta answered Oct 6, 2025 soudipta_dutta comment Share Follow 0 reply Please log in or register to add a comment.