Hi All;
tell me please if my steps in solving this problem is right or wrong and if there any mistakes please explain to me ^_^
Write a method that takes an integer N and returns an array of integers of length N. The elements of the array are a randomly generated odd numbers. The signature of the method is as follows
static int[] generateOddRandomArr(int N)
i solve it as follow:
public static int[] generateOddRandomArr(int N){
int W=N;
for(int i=N;i<arr.length;i++){
arr[i]=N.get(i);
if (int[i]%2!=0)W=N;
}
return W;
}