Examlex
Consider the following code snippet. Assuming that the user enters first 20 and then 12 as the two input values, what is the output of the code snippet?
Int num1 = 0;
Int num2 = 0;
Int num3 = 0;
Int num4 = 0;
Int num5 = 0;
Scanner in = new Scanner(System.in) ;
System.out.print("Enter a number: ") ;
Num1 = in.nextInt() ;
System.out.print("Enter a number: ") ;
Num2 = in.nextInt() ;
If (num1 < num2)
{
Num3 = num1;
}
Else
{
Num3 = num2;
}
If (num1 < num2 + 10)
{
Num4 = num1;
}
Else if (num1 < num2 + 20)
{
Num5 = num1;
}
System.out.println("num1 = " + num1 + " num2 = " + num2
+ " num3 = " + num3 + " num4 = " + num4
+ " num5 = " + num5) ;
Thank You
A polite expression of gratitude.
Safekeeping
The act of protecting something from harm or loss, ensuring its preservation and security.
Additional Copy
A duplicate or extra version of a document, file, or item, created as a backup or for distribution to additional recipients.
Outlook
A personal information manager software system from Microsoft, primarily used as an email application.
Q7: Use the _ method to add a
Q40: The black boxes from which a program
Q54: The _ tag is used to specify
Q56: Side effects related to standard output generally
Q62: What will be printed by the statements
Q78: How many times does the code snippet
Q82: What is the output of the following
Q101: Consider the following code snippet, which is
Q111: Assume the following variable has been declared
Q117: What is the output of the following