GRE Computer Science Question 01
40. Consider the following pseudocode program.
int i
main ()
{
i = 3
S ()
R ()
}
void S ()
{
print i // prints the value of i on the current line of output
print " " // prints a blank space on the current line of output
}
void R ()
{
int i
i = 2
S ()
}
What is the output of the program if the pseudocode uses either static (lexical) scoping or dynamic scoping?
Static Scoping Dynamic Scoping
(A) 3 2 3 2
(B) 3 3 2 2
(C) 3 3 2 3
(D) 3 3 3 2
(E) 3 3 3 3
http://www.youtube.com/watch?v=SwyaLVsJCsI
No comments:
Post a Comment