Kat H.

asked • 05/03/21

MyMin. Write a function: int myMin(int num1, int num2)

Write a function:

int myMin(int num1, int num2)


It should return the lesser of the two parameters.


Code:


#include <iostream>

using namespace std;

//Do not modify anything on or above the line below this

//YOUR_CODE_BELOW


//YOUR_FUNCTION HERE


//YOUR_CODE_ABOVE

//Do not modify anything on or below the line above this


int main()

{

cout << myMin(4, 8) << endl;

cout << myMin(6, 3) << endl;

cout << myMin(-2, -4) << endl;

}

1 Expert Answer

By:

Dan B. answered • 05/03/21

Tutor
5 (20)

Experienced University Level Tutor in Software Engineering

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.