Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

Why do corporations utilize different forms of equity?

Answered: 1 week ago

Question

Why does sin 2x + cos2x =1 ?

Answered: 1 week ago

Question

How to solve maths problems with examples

Answered: 1 week ago