PrepAway - Latest Free Exam Questions & Answers

What is the output of this code?

Consider the following program code:
$var = 10;
package Alpha;
$var = 20;
{
package Beta;
$var = 30;
}
package Gamma;
$var = 40;
{
print $var;
}
What is the output of this code?

PrepAway - Latest Free Exam Questions & Answers

A.
10

B.
20

C.
30

D.
40


Leave a Reply