I am trying to determine if the product of all the integers is even or odd.
I have a list of integers, and I want to check if the product of the integers is even or odd.
For example:
determineIfEvenOrOdd([6,7,9,9])
function determineIfEvenOrOdd(int_array) {
//Code here
}
I was thinking of looping through the array and multiplying the numbers to find out the product of the array integers. But then I thought it would be expensive to do this if the array was huge.
I am a beginner, and would like to know a possible approach for the solution.