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]
2 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]2 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
Which ics function records time accounting and procures needed items?
vladimir1956 [14]
It is the finance / administration function that records time accounting and procures the needed items
7 0
3 years ago
________ are devices in a computer that are in either the on or off state
Vanyuwa [196]
The appropriate response is Electrical Switches. These are electromechanical gadgets that are utilized as a part of electrical circuits to control, recognize when frameworks are outside their working reaches, flag controllers of the whereabouts of machine individuals and work pieces, give a way to manual control of machine and process capacities, control lighting, et cetera.
6 0
3 years ago
A. The client is running in a loop:
Ierofanga [76]
Aaaaaaaaaaaaaaaaaaaaaaaaaaaa
4 0
3 years ago
Read the following scenario. How might Sarah correct successfully complete her task? To permanently remove a file from her compu
Mekhanik [1.2K]

I'd go with two answers.

A: To permanently remove a file from her computer, Sarah doubled-clicked on the My Computer icon and searched for her file under the “Uninstall or change a program” menu option.

Or

B: Empty the Recycle Bin.

This question is somewhat not clear. Why I went with the answers above is because I really do not know what kind of a file Sarah wants to permanently remove. You can permanently delete a program file installed in the computer by following the procedure in option A. The option above will take you to the control panel and you'll be able to select the program you'd want to permanently remove. If you had initially deleted a file like a picture or a document or anything else that you necessarily do not need, it will go to recycle bin. You can head over there and select the Empty the Recycle Bin option to permanently delete the file.

7 0
3 years ago
Proxy is a network computer that can serve as an intermediary for connecting with other computers.
Keith_Richards [23]

Answer:Protects the local network from outside access

Explanation:Proxy is a type of serves as the mediator in computer network for connecting the network with the user system. These servers are responsible for maintaining the security against any unauthorized access in the system or internet,privacy and other functions.. It helps in protecting the whole network connection by taking the control at the servers .

8 0
3 years ago
Other questions:
  • What is a block cipher algorithm that operates on 64-bit blocks and can have a key length from 32 to 448 bits?
    8·1 answer
  • you are the manager of a virtual team that is working on a project. You uploaded a Word document to an OneDrive account that you
    9·1 answer
  • Exceptions can be handled in all of these ways except:
    6·1 answer
  • What is the range of possible sizes for side<br> x?<br> 4.0<br> 2.7
    8·1 answer
  • What is the effect of this program?
    5·1 answer
  • In an experiment in which participants sat in an office and then were asked to remember what they saw in the office, participant
    6·1 answer
  • Which of the following substances increases in quantity during repititive muscle contraction during oxygen deficti ?
    11·1 answer
  • Select the correct answer.<br> What do you understand by "exposition"?
    10·2 answers
  • Teenagers and their parents will never understand each other-the generation gap is too big. Its for my grade 11 English speech​
    10·2 answers
  • What operating system are you using? On most computers, you can answer this question by right-clicking on the "My Computer" icon
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!