MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / takeInput

Method takeInput

Java/Array/BubbleSort.java:68–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 }
67
68 public static int[] takeInput() {
69 Scanner sc = new Scanner(System.in);
70 System.out.println("Enter the length of the array: ");
71 int n = sc.nextInt();
72 int [] arr = new int[n];
73 System.out.println("Enter the elements of the array: ");
74 for (int i = 0; i < n; i++) {
75 arr[i] = sc.nextInt();
76 }
77 return arr;
78 }
79
80 public static void main(String[] args) {
81 int [] arr = takeInput();

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected