ICSE Class 9 Computer Applications Question 6 of 17

Conditional Constructs in Java — Question 6

Back to all questions
6
Question

Question 6

Write an if statement to find the smallest of the three given integers using the min() method of the Math class.

Answer
if (a < Math.min(b, c))
  System.out.println(a);
else
  System.out.println(Math.min(b, c));