Write a Java function called SpOdd. The function takes an array of integers as input and return an array of integers with all odd numbers in original array. Keep the same order as the original array. Then test your function in main function. Sample output of main function: Original Array: [3, 8, 5, 7, 1, 9, 2] Odd elements in the array: [3, 5, 7, 1, 9] Please submit your java file

icon
Related questions
Question
Can someone please explain to me ASAP??!!!
Write a Java function called SpOdd. The function takes an array of integers as input and return an
array of integers with all odd numbers in original array.
Keep the same order as the original array. Then test your function in main function.
Sample output of main function:
Original Array: [3, 8, 5, 7, 1, 9, 2]
Odd elements in the array: [3, 5, 7, 1, 9]
Please submit your java file
Transcribed Image Text:Write a Java function called SpOdd. The function takes an array of integers as input and return an array of integers with all odd numbers in original array. Keep the same order as the original array. Then test your function in main function. Sample output of main function: Original Array: [3, 8, 5, 7, 1, 9, 2] Odd elements in the array: [3, 5, 7, 1, 9] Please submit your java file
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer