How to make algorithms and flowchart of to find the largest number among the three numbers . As long as the user enter zero
Answers
Answered by
0
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ArrayList<Integer> num = new ArrayList<Integer>();
for(int i = 0; i < 3; i++)
{
System.out.println("Enter number " + (i+1));
int x = scanner.nextInt();
num.add(x);
}
int y = Collections.max(num);
System.out.println("The largest of the 3 numbers is " + y);
}
}
Explanation:
Similar questions
Math,
1 day ago
Math,
1 day ago
Accountancy,
1 day ago
Computer Science,
2 days ago
Math,
8 months ago
English,
8 months ago
Art,
8 months ago