-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutilityArray.java
More file actions
30 lines (26 loc) · 806 Bytes
/
Copy pathutilityArray.java
File metadata and controls
30 lines (26 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.Scanner;
public class utilityArray {
public static void main(String[] args) {
}
public static int[] inputArray(){
Scanner input=new Scanner(System.in);
System.out.print("Enter the size of the Array ");
int size= input.nextInt();
int[] ArrayElements= new int[size];
int i=0;
while(i < size){
System.out.print("Enter the element no "+ (i+1)+":");
ArrayElements[i]= input.nextInt();
i++;
}
return ArrayElements;
}
public static int[] DisplayArray(int[] arr){
int i=0;
while(i< arr.length){
System.out.print(arr[i]+"\t");
i++;
}
return arr;
}
}