Solved

Assuming That the User Provides 303 as Input, What Is

Question 12

Multiple Choice

Assuming that the user provides 303 as input, what is the output of the following code snippet?
Int x;
Int y;
X = 0;
Scanner in = new Scanner(System.in) ;
System.out.print("Please enter a number: ") ;
Y = in.nextInt() ;
If (y > 300)
{
X = y;
}
Else
{
X = 0;
}
System.out.println("x: " + x) ;


A) x: 0
B) x: 300
C) x: 303
D) There is no output due to compilation errors.

Correct Answer:

verifed

Verified

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

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents