Write a function that takes in a vector of ints as a parameter, then removes all the even numbers from the vector. This will be tested via a unit test, so you do not need to write anything in your main function (unless you want to test the RemoveEvenNums function on your own, which we strongly recommend). You will need a main() function (even if it is empty) below your function for the test cases to compile and run. Your code must have a function called void RemoveEvenNums(vector& numbers) (it must be formatted exactly like this). We've already given you the function declaration, it is up to you to define it correctly.
C++ !
Write a function that takes in a vector of ints as a parameter, then removes all the even numbers from the vector.
This will be tested via a unit test, so you do not need to write anything in your main function (unless you want to test the RemoveEvenNums function on your own, which we strongly recommend). You will need a main() function (even if it is empty) below your function for the test cases to compile and run.
Your code must have a function called void RemoveEvenNums(vector<int>& numbers) (it must be formatted exactly like this). We've already given you the function declaration, it is up to you to define it correctly.
#include <iostream>
#include <vector>
using namespace std;
void RemoveEvenNums(vector<int> & numbers);
int main(){
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images