Answered You can hire a professional tutor to get the answer.

QUESTION

What is the best output of each of the following statements?

What is the best output of each of the following statements? Assume that a = 10, b = 5, c = 8, and temp = 0

1. if (a <= b)

b = a;

System.out.println(a + " " + b);

2. if (a <= b)

{

b = a;

System.out.println(a + " " + b);

}

3. if (a < b)

{

if (b + c < a)

System.out.println(c + " " + b);

else

System.out.println(b + " " + c);

}

System.out.println(b + " " + a);

4. if (a > b)

{

if (b + c < a)

System.out.println(c + " " + a);

else

System.out.println(b + " " + c);

}

else

System.out.println(b + " " + a);

5. if (a > b)

{

c = c + b;

if (c > a)

{

System.out.println(temp + " " + c);

}

else

{

b = 2 * b;

System.out.println(b + " " + c);

}

}

else

{

a += 5;

System.out.println(a + " " + b);

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question