Write an application that stores the following nine integers in an array: 10, 15, 19, 23, 26, 29, 31, 34, 38. Display the integers from first to last, and then display the integers from last to first.
-----------------------------------------------
public class NineInts {
public static void main (String args[]) {
// Write your code here
}
}
------------------------
Please use JAVA
public class NineInts { public static void main(String args[]) { int[] numbers = {10, 15, 19, 23, 26, 29, 31, 34, 38}; for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i] + " "); } System.out.println(); for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[numbers.length - i - 1] + " "); } System.out.println(); } }
Get Answers For Free
Most questions answered within 1 hours.