(the code is in the image attached) consider the following code (execution begins in main). What is the output of the following code. A. Assuming static (lexical) scope binding of names? B.Assuming dynamic scope binging?
(the code is in the image attached) consider the following code (execution begins in main). What is the output of the following code. A. Assuming static (lexical) scope binding of names? B.Assuming dynamic scope binging?
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
(the code is in the image attached) consider the following code (execution begins in main). What is the output of the following code.
A. Assuming static (lexical) scope binding of names?
B.Assuming dynamic scope binging?
![int i = 1; /* global variable */
int j = 2; /* global variable */
void a() {
int i = 5;
int j = 6;
j++;
b(i);
}
void b(int k) {
}
printf("%d %d %d\n", i, j, k);
}
void main() {
a();](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F82eb2375-289d-4fe0-bd7d-cd5bfb788f09%2Fe671ed05-c865-46f6-a75f-17cd1d5daf42%2Fnboeju_processed.png&w=3840&q=75)
Transcribed Image Text:int i = 1; /* global variable */
int j = 2; /* global variable */
void a() {
int i = 5;
int j = 6;
j++;
b(i);
}
void b(int k) {
}
printf("%d %d %d\n", i, j, k);
}
void main() {
a();
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)