Question: I need help to answer these questions on this program that I created. 1 Insert cout statements when the max() function is entered. 2 cout

I need help to answer these questions on this program that I created.

1 Insert cout statements when the max() function is entered. 2 cout << " (testing) max() called, arguments: num1 = " << num1 << " and num2 = " << num2 << endl; 3 Does it make sense? 4 Elements to be recognized part of a very simple C++ program. 5 Could we recognize a number in the sting A = +1260; an integer number? What is the algorithm? If YES, can we find the value in binary?

########################################################

#include #include

using namespace std;

//returns the max of two passed arguments int max(int, int);

//returns the max of three passed arguments int max3(int, int, int);

int main() { int i = 5; int j = 2;

int k = max(i, j);

cout << " the max, etc, is " << k << endl;

cout << " max(5, max (2, 5)) is " << max(5, max(2, 5)) << endl;

cout << " max3(-5, 2, 10) is " << max3(-5, 2, 10) << endl;

cout << " End of program" << endl;

system("DATE /T"); system("PAUSE"); return 0; }

int max(int num1, int num2) { int result; if (num1 >= num2) result = num1; else result = num2; return result; }

int max3(int x, int y, int z) {

return max(x, max(y, z));

}

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!