Examlex
Assuming that a user enters 5 as the value for num, what is the output of the following code snippet?
Int num = 0;
Scanner in = new Scanner(System.in) ;
System.out.print("Enter a number: ") ;
Num = in.nextInt() ;
If (num < 50)
{
Num = num + 5;
}
If (num < 10)
{
Num = num - 2;
}
If (num > 5)
{
Num++;
}
Else
{
Num--;
}
System.out.println(num) ;
Q20: What will be printed by the statements
Q34: What will be the output of the
Q38: What will be output from the following
Q41: Consider the following code snippet:<br>Int[][] arr =<br>{<br>{
Q47: Why does the Scanner class belong to
Q66: The output of a method is called
Q73: Assume the array of integers values has
Q77: Which of the given statements generates the
Q82: Consider the hierarchy of classes shown below.
Q118: What does the following statement sequence print?