Write a program that accepts natural numbers A, B, and C less than or equal to 100 and prints the smallest of the three numbers. (don’t use sort)
Three natural numbers less than or equal to 100 are entered in the first line.
6, 5, 11
Print the smallest number on the first line.
5
if
function solution(a, b, c) {
let answer;
if (a < b) answer = a;
else answer = b;
if (c < answer) answer = c;
return answer;
}
sort()
function solution(a, b, c) {
let answer = [a, b, c];
answer.sort((a, b) => a - b);
return answer[0];
}
Math.min()
function solution(a, b, c) {
return Math.min(a, b, c);
}