Assuming that a user enters 5 as the age, what is the output of the following code snippet?
Int age = 0;
Scanner in = new Scanner(System.in) ;
System.out.print("Please enter your age: ") ;
Age = in.nextInt() ;
If (age < 10)
{
System.out.println("Kid") ;
}
If (age < 30)
{
System.out.print("Young") ;
}
If (age < 70)
{
System.out.print("Aged") ;
}
If (age < 100)
{
System.out.print("Old") ;
}
A) Kid
B) Kid
Young
C) Kid
YoungAged
D) Kid
YoungAgedOld
Correct Answer:
Verified
Q36: Consider the following code snippet:
Int number =
Q37: What is the output of the following
Q38: When an if statement is nested inside
Q39: Write an if-statement condition that is true
Q40: What is the output of the following
Q44: What is the output of the following
Q45: What is the output of the following
Q46: Consider the following code snippet. Assuming that
Q81: Which of the following operators is used
Q84: The flow chart shows the order in
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