1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
frosja888 [35]
3 years ago
11

Consider the following skeletal C program: void fun1(void); /* prototype */ void fun2(void); /* prototype */ void fun3(void); /*

prototype */ void main() { int a, b, c; . . . } void fun1(void) { int b, c, d; . . . } void fun2(void) { int c, d, e; . . . } void fun3(void) { int d, e, f; . . . } 256 Chapter 5 Names, Bindings, and Scopes Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during execution of the last function called? Include with each visible variable the name of the function in which it was defined. a. main calls fun1; fun1 calls fun2; fun2 calls fun3. b. main calls fun1; fun1 calls fun3. c. main calls fun2; fun2 calls fun3; fun3 calls fun1. d. main calls fun3; fun3 calls fun1. e. main calls fun1; fun1 calls fun3; fun3 calls fun2. f. main calls fun3; fun3 calls fun2; fun2 calls fun1
Computers and Technology
1 answer:
natita [175]3 years ago
8 0

Answer:

Check the explanation

Explanation:

a) main calls fun1; fun1 calls fun2; fun2 calls fun3

fun3()                                        d, e, f

fun2()                                        c, d, e

fun1()                                        b, c, d

main()                                        a, b,c

CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION

   From the above call stack diagram, it is very clear that the last function call is made to fun3().

   In fun3(), the local variables "d, e, f" of fun3() will be visible

   variable "c" of fun2() will be visible

   variable "b" of fun1() will be visible

   variable "a" of main() will be visible

b) main calls fun1; fun1 calls fun3

fun3()                                        d, e, f

fun1()                                        b, c, d

main()                                        a, b,c

CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION

   From the above call stack diagram, it is very clear that the last function call is made to fun3().

   In fun3(), the local variables "d, e, f" of fun3() will be visible

   variable "b, c" of fun1() will be visible

   variable "a" of main() will be visible

c) main calls fun2; fun2 calls fun3; fun3 calls fun1

fun1()                                        b, c, d

fun3()                                        d, e, f

fun2()                                        c, d, e

main()                                        a, b,c

CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION

   From the above call stack diagram, it is very clear that the last function call is made to fun1().

   In fun1(), the local variables "b, c, d" of fun1() will be visible

   variable "e, f" of fun3() will be visible

   variable "a" of main() will be visible

d) main calls fun1; fun1 calls fun3; fun3 calls fun2

fun2()                                        c, d, e

fun3()                                        d, e, f

fun1()                                        b, c, d,

main()                                        a, b,c

CALL STACK SHOWING THE VARIABLES OF EVERY FUNCTION

   From the above call stack diagram, it is very clear that the last function call is made to fun2().

   In fun2(), the local variables "c, d, e" of fun2() will be visible

   variable "f" of fun3() will be visible

     variable "b" of fun1() will be visible

   variable "a" of main() will be visible

The last function called will comprise of all its local variables and the variables other than its local variables from all its preceding function calls till the main function.

You might be interested in
The qwerty keyboard is the most common layout of keys on a keyboard.
vagabundo [1.1K]
The qwerty keyboard is the most common keyboard.
6 0
4 years ago
Read 2 more answers
What data type can be used to hold any single character, including numbers and non-printing characters?
SVEN [57.7K]

Answer:

char

Explanation:

The character data type written as char holds any single character, numbers and non-printing characters. In java and most programming languages, the value of the character must be placed within single quotes. for example

char c = 'd'

char c = '9'

char c = '\t'

Are all valid declarations of a variable c as char and assigned d, then 9 and then used with a non-printing character (tab ) with the escape sequence.

8 0
3 years ago
Read 2 more answers
ystem, the design of which was developed using customary structured methods. To manage the intricacy of the application developm
Soloha48 [4]

Answer:

Organized plan is utilized to change the auxiliary examination (for example modules and their interrelation) into a straightforward graphical structure. It is essentially done in two stages:  

1. Transform Analysis  

2. Transaction Analysis  

For showing control stream in organized investigation we use Flow diagrams, But for indicated choice in organized examination, we frequently use choice tree. In choice tree we use hover for current state. An example decision tree is attached with the appropriate response, benevolently allude the equivalent.

4 0
3 years ago
Terrence smiles at his customers, helps his cowokers,and stays late when needed. What personal skill does Terrence demonstrate
adell [148]

Answer: Humility,kindness

Explanation:

5 0
3 years ago
Read 2 more answers
Use the YEARFRAC function to work out how many years difference is there between the date 1980-07-31 (31 July 1980) and 1998-05-
zhenek [66]

Answer: 17.7 Years

Explanation:

YEARFRAC is a function in Microsoft Excel that returns the year fraction representing the number of whole days between a particular start date and an end date.

A typical view of the function is:

=YEARFRAC(start_date, end_date, [basis])

All that needs to be done is

1. Type in the equal to sign(=) in the cell you want your answer,

2. Type in YEARFRAC and open your bracket,

3. Input your start date and end date, close your bracket and press enter.

6 0
3 years ago
Other questions:
  • a conpany manufacturers computer screens that utilize less electricity. which form of technology would this be classified as​
    5·1 answer
  • Which type of spreadsheet cell represents the left hand sides (lhs) formulas in an optimization analysis?
    5·1 answer
  • How do you bookmark a website in each of the internet browsers?
    9·1 answer
  • What is output when the CarTest application is run? Why?
    11·1 answer
  • A company used computer auditing techniques to compare employees' telephone numbers with vendors' telephone numbers. This is an
    10·2 answers
  • true or false then EXPLAIN why. Since many forms of money do not earn interest, people's demand for money is unaffected by chang
    14·2 answers
  • Which of the following is NOT true about simple machines?
    10·1 answer
  • Sarah is having a hard time finding a template for her advertising business that she may be able to use at a later
    12·1 answer
  • What is computer and example<br>​
    5·1 answer
  • If you are inviting more than one person to a meeting, you can use a(n) _____ to separate the email addresses.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!