Millionaire Mode

Java Core Fundamentals - Practice Test 6

Question 1 of 25

public void test(int x)
{
int odd = 1;
if(odd) /* Line 4 */
{
System.out.println(odd);
}
else
{
System.out.println(even);
}
}


Which statement is true?

  1. Compilation fails.
  2. odd will always be the output.
  3. even will always be the output.
  4. odd will be the output for odd values of x, and even for even values.

Prize Money

15₹7 Crores
14₹1 Crore
13₹50,00,000
12₹25,00,000
11₹12,50,000
10₹6,40,000
9₹3,20,000
8₹1,60,000
7₹80,000
6₹40,000
5₹20,000
4₹10,000
3₹5,000
2₹2,000
1₹1,000