ICSE Class 10 Computer Applications Question 10 of 43

Conditional Constructs in Java — Question 10

Back to all questions
10
Question

Question 10

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));