Examlex

Solved

Assuming That a User Enters 10, 20, and 30 as Input

question 53

Multiple Choice

Assuming that a user enters 10, 20, and 30 as input values one after another, separated by spaces, what is the output of the following code snippet?
Int num1 = 0;
Int num2 = 0;
Int num3 = 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() ;
System.out.print("Enter a number: ") ;
Num3 = in.nextInt() ;
If (num1 > num2)
{
If (num1 > num3)
{
System.out.println(num1) ;
}
Else
{
System.out.println(num3) ;
}
}
Else
{
If (num2 > num3)
{
System.out.println(num2) ;
}
Else
{
System.out.println(num3) ;
}
}


Definitions:

Demand

The desire combined with the ability to purchase a specific quantity of a good or service at a particular price and time.

Supply

The total amount of a product or service available for purchase at any given price point in a market.

Purchasing Power Parity

A theory in economics that suggests that in the absence of transaction costs and other barriers, identical goods should have the same price in different countries when prices are expressed in a common currency.

Prices

Monetary values assigned to products and services which are determined by the interaction of supply and demand in the market.

Related Questions