+ 1
Given an array of positive even and odd numbers. We have to find the index of largest even number. Use that maximum even number
Input Test Case: An array of positive even and odd numbers 7 3 5 4 13 11 21 Output Test Case: A Number. 64
3 odpowiedzi
+ 15
well , I noticed that output is sum of array elements 😃
Anyways by seeing the question , it looks like u need to find largest even number in the array , so idea for it
1)make duplicate array of it ,sort it using Arrays.sort();
2)then start from last index & go in beginning , whenever even number come it is the largest , check by %2==0
3)then go in original array & find the index of that element
//simple ☺👍 , other solution also exists .
+ 5
The most interesting part of the OP's request is the chosen tags for covering 3 different languages which makes it even worse! Like a hunter who is hunting all kinds of animals and collecting their heads for his collection!
C++
Java
C
It really reveals the lack of a goal, being in a rush to prepare the assignment, and being carefree about the outcome of his work.
+ 3
Beside being unclear your output (for me), where is your attempt?