Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4076106
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:22:59+00:00 2026-05-20T17:22:59+00:00

after reading few post in this forum on this topic i had better understanding

  • 0

after reading few post in this forum on this topic i had better understanding on static and dynamic scoping.
However, i have encountered a problem from internet and seems to face issues to get around with that.
The code is as follows:

x : integer                   –– global
procedure set x(n : integer)
   x := n
procedure print x
   write integer(x)
procedure first
   set x(1)
   print x
procedure second
   x : integer
   set x(2)
   print x

set x(0)
first()
print x
second()
print x

What does this program will print if we use static scoping and What does it print if we use dynamic scoping?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:22:59+00:00Added an answer on May 20, 2026 at 5:22 pm

    It’s not that easy to predict what will happen in some imaginary language after launching a pseudocode but expected result will be:

    1 - procedure 'first' output
    2 - procedure 'second' output
    1 - 'main' output
    

    P.S. those are not called static/dynamic. Those are global/local. At least in those languages I know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few questions about this after reading the iPhone documentation on it:
After reading the Bash man pages and with respect to this post , I
This is probably such a simple question, but after reading a few tutorials and
After reading a few question/answers here I have managed to work out how to
After reading a few posts here I formulated this function which is sort of
After reading answer to this question: Make "make" default to "make -j 8" I
After reading MSDN-XAML Namespaces and MSDN-Understanding XAML Namespaces , I still do not understand
After reading this question, I need to clear up some things. IQueryable<Customer> custs =
After reading a few enlightening articles about memory in the .NET technology, Out of
I'd never heard about wildcars until a few days ago and after reading my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.