Solved

What Will Be Printed When the Following Code Is Executed

Question 49

Multiple Choice

What will be printed when the following code is executed?
Int y = 10;
If ( y == 10)
{
Int x = 30;
X += y;
}
System.out.print("x = ") ;
System.out.print(x) ;


A) x = 30
B) x = 40
C) x = 20
D) x is unknown when the last statement is executed.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions