Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package array.input;
- import java.util.Scanner;
- public class ArrayInput {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- System.out.print("How many element do you want to enter/ Array size : ");
- int n = input.nextInt();
- int a[]= new int[n];
- System.out.print("Enter the elemebt : ");
- for (int i =0 ; i<a.length ; i++)
- {
- a[i]=input.nextInt();
- }
- for (int i =0 ; i<a.length ; i++)
- {
- System.out.print(a[i]+" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement