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
Fill in the blanks (...)C++ homework #include <iostream>using namespace std;class Date {public:….. void setDate(int date_day, int date_month, int date_year){ //put the date……………….} void getDate(){//show the date………}}; // end class //... int main(){int day,month,year; cout<<"Please enter the currents day, month and year"<<endl;cout <<"enter day: ";cin >> day;cout <<"enter month: ";cin >> month;cout <<"enter year: ";cin >> year; Date today; today.setDate(day,month,year);today.getDate(); Date yesterday;yesterday.setDate(day-1,month,year);cout<<"Yesterday ";yesterday.getDate(); return 0;}
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, whatvariables are visible during the execution of the last function? Include with each visible variablethe 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.     Consider the following program, written in JavaScript-like syntax: // main programvar x, y, z;function sub1() {var a, y, z;. . .}function sub2() { var a, b, z; . . .}function sub3() { var a, x, w; . . .}Given the following calling sequences and…
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
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
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