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:
Verified
Q12: A block of code is enclosed in
Q21: Enclosing a group of statements inside a
Q22: The expression tested by an if statement
Q24: What would be the value of discountRate
Q26: What will be the value of charges
Q28: What would be the value of discountRate
Q29: Which of the following is the correct
Q30: What is the value of ans after
Q49: What would be the value of discountRate
Q54: If str1 and str2 are both Strings,
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents