Question: C++ write a function called int smallest(vector numbers) that returns the smallest number in the vector. This is my code, I'm not sure what I'm

C++ write a function called int smallest(vector numbers) that returns the smallest number in the vector.

This is my code, I'm not sure what I'm doing wrong.

#include #include

using std::cin; using std::cout; using std::endl; using std::vector;

int smallest(vectornumbers) { int small = numbers; if (int x{0}; x

int main() { vectornum {10,65,2,38,69,3}; cout << smallest (num) << endl;

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!