1
2
3
4
5
6
Use the "Verify Solution" button to get AI feedback on your C++ code.
You are tasked with implementing a function sumEvenNumbers that calculates the sum of all even numbers present in a given std::vector<int>.The function should:1. Accept a const std::vector<int>& as input.2. Iterate through the vector.3. Add only the even numbers to a running total.4. Return the final sum.The provided starterCode has a logical error in the even number check and an incorrect loop condition. Your goal is to identify and correct these issues to make the function work as expected.