Answer to Question #281829 in Java | JSP | JSF for Sara

Question #281829

Write a program reads and store 10 integer elements in an array 


1
Expert's answer
2021-12-21T12:28:08-0500
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] array = new int[10];
        for (int i = 0; i < array.length; i++) {
            System.out.print((i + 1) + " Element: ");
            array[i] = in.nextInt();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog