Write a code fragment that reads 10 integer values from the user and prints the highest value entered.
What will be an ideal response?
```
Scanner scan = new Scanner(System.in);
int max, number;
System.out.print("Enter an integer: ");
max = scan.nextInt();
for (int count = 2; count <= 10; count++)
{
System.out.print("Enter another integer: ");
number = scan.nextInt();
if (number > max)
max = number;
}
System.out.println("The highest value is :" + max);
```
Computer Science & Information Technology
You might also like to view...
To illustrate the relationship of the parts to the whole, you would use a(n) ________ chart
A) Line B) Pie C) Scatter D) Area
Computer Science & Information Technology
Macro Buttons in worksheets are ________ buttons available on the Developer tab
Fill in the blank(s) with correct word
Computer Science & Information Technology