-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.java
More file actions
17 lines (16 loc) · 442 Bytes
/
Array.java
File metadata and controls
17 lines (16 loc) · 442 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import java.util.Scanner;
class Array{
public static void main(String args[]){
int i;
int arr[] = new int [5];
Scanner sc = new Scanner(System.in);
System.out.println("Enter array elements");
for(i=0; i<5; i++){
arr[i] = sc.nextInt();
}
System.out.println("Array elements are: ");
for(i=0; i<5; i++){
System.out.print(arr[i]+" ");
}
}
}