0

How to store all for loop result in an array ( out side the for loop) in java?

want to store all result of loop in an array.

5th Jan 2018, 5:41 AM
Krishanu Debnath
Krishanu Debnath - avatar
1 Answer
0
what do u mean by loop result? i'll assume u want to store 1 til n into array of length n int n = 5; int[] arr = new arr[n]; for (int i = 0; i < n; i++) { arr[i] = i + 1; }
5th Jan 2018, 6:54 AM
Arthur Queiroz Moura
Arthur Queiroz Moura - avatar