0
Show the printout of the following code: Suppose the input is 2 3 4 5 0. What is the output of the following code?
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner input = new Scanner(System.in); int number, max; number = input.nextInt(); max = number; while (number != 0) { number = input.nextInt(); if (number > max) max = number; } System.out.println("max is " + max); System.out.println("number " + number); }
2 ответов
+ 2
For the only output, you can find it in code playground...
+ 1
Try on Code playground. Then if you have any doubt ask here.