Concepts of Programming Languages (11th Edition)
Concepts of Programming Languages (11th Edition)
11th Edition
ISBN: 9780133943023
Author: Robert W. Sebesta
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 5, Problem 11PS

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;

. . .

}

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.

  1. a. main calls fun1; fun1 calls fun2; fun2 calls fun3.
  2. b. main calls fun1; fun1 calls fun3.
  3. c. main calls fun 2; fun2 calls fun3; fun3 calls fun1.
  4. d. main calls fun 3; fun 3 calls fun l.
  5. e. main, calls fun 1; fun 1 calls fun 3; fun 3 calls fun 2.
  6. f. main calls fun 3; fun 3  calls fun 2; Calls fun 1.
Blurred answer
Students have asked these similar questions
Need help in this question 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;. . .}Given the following calling sequences and assuming that dynamic scopingis used, what variables are visible during execution of the last functioncalled? Include with each visible variable the name of the function inwhich 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 fun
int main() { E(); C(); E(); } void B() {...} void C() {..} void D() {..} void E() { B(); D(); } A variable declared in function B and only in function B is accessible in?
int main() { E(); C(); E(); } void B() {...} void C() {...} void D() {...} void E() { B(); D(); } Which describes the order in which the functions are called when the program is run?
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
What is Abstract Data Types(ADT) in Data Structures ? | with Example; Author: Simple Snippets;https://www.youtube.com/watch?v=n0e27Cpc88E;License: Standard YouTube License, CC-BY