Write a program that calls a method to ask the user for 10 integersand then call
ID: 3615454 • Letter: W
Question
Write a program that calls a method to ask the user for 10 integersand then calls another methodthat prints those 10 integers to the screen in reverse order (usean array; you may not use global
variables). Name your program Lab10_Ex1.java
Note: The length operator will report the number of elementsin an array (or you can pass the
number of elements to your method via a parameter). If thearray name is: numbers, then the
number of elements in the array is stored into the int variablesize by: size = numbers.length.
Explanation / Answer
please rate - thanks import java.util.*; public class Lab10_Ex1 {public static void main(String[] args) {int n=10,i; int [] num=new int[n]; Scanner in=new Scanner(System.in); System.out.println("Enter "+n+" numbers:"); for(i=0;i=0;i--) System.out.print(a[i]+" "); } }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.