- Home /
- Java /
- PRG420 Java Programming I /
- PRG/420 Week 4 Java 4.16 LAB: Two smallest numbers
Details
PRG/420 Week 4 Java 4.16 LAB: Two smallest numbers
Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and fewer than 20 integers.
Ex: If the input is:
5 10 5 3 21 2
the output is:
2 3
To achieve the above, first read the integers into an array.
Hint: Make sure to initialize the second smallest and smallest integers properly.
Additional Information
Special Price | $3.00 |
---|
Product Tags
Use spaces to separate tags. Use single quotes (') for phrases.
Check items to add to the cart or select all
-
PRG/420 Week 4 Java 4.9 LAB: Output numbers in reverse
Regular Price: $7.00
Special Price $3.00
-
PRG/420 Week 4 Java 4.11 LAB: Output values below an amount
Regular Price: $7.00
Special Price $3.00
-
PRG/420 Week 4 Java 4.12 LAB: Adjust list by normalizing
Regular Price: $7.00
Special Price $3.00
-
PRG/420 Week 4 Java 4.13 LAB: Word frequencies
Regular Price: $7.00
Special Price $3.00
-
PRG/420 Week 4 Java 4.14 LAB: Contains the character
Regular Price: $7.00
Special Price $3.00
-
PRG/420 Week 4 Java 4.15 LAB: Elements in a range
Regular Price: $7.00
Special Price $3.00
You have no items in your shopping cart.