Muhaiminur
2/12/2018 - 8:58 PM

Write a java program that reads 10 numbers from the user. The program then reads a number between 0 to 9, and shows the number at the corres

Write a java program that reads 10 numbers from the user. The program then reads a number between 0 to 9, and shows the number at the corresponding index number. For instance, if the array is a and the user enters 3, your program should print the value a[3].

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package BASICJAVA;

import java.util.Scanner;

/**
 *
 * @author ABIR
 */
public class Read_Number_And_Print_Index {
    public static void main(String[]args){
        Scanner abir =new Scanner(System.in);
        int[] number=new int[10];
        for (int i = 0; i < number.length; i++) {
            System.out.println("Enter your "+(i+1)+" number");
            number[i]=abir.nextInt();
        }
        System.out.println("Enter your index number");
        int i=abir.nextInt();
        System.out.println("Index Number is" +number[i]);
    }
}