Question: #include #include using namespace std; //Write a template function called average that get an template array A and integer value l which is length of

#include  #include  using namespace std; //Write a template function called average that get an template array A and integer value l which is length of array // and return the average of the elements in the array //**************TO DO********************* //Using the methods of vector, remove all negative values from the vector. //Report the complexity of the method too. //Hint: Notice what is the return of the method void remove_negatives(vector &V) { //**************TO DO********************* } int main() { int array1[] = { 5, 3, 2, 1, 4 }; cout << "This should be 3: "< V{ 2, -7, -3,5, -1, 0, -4 }; remove_negatives(V); cout << "There should not be any negative in the following line: (2 5 0) " << endl; for (int a : V) cout << a << ' '; return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!