Question: C++ PROGRAMMING. USE FUNCTION TO PROGRAM THE ASSIGNMENT Below program asks user for three integers and prints the smallest and largest of those three on

C++ PROGRAMMING. USE FUNCTION TO PROGRAM THE ASSIGNMENT

Below program asks user for three integers and prints the smallest and largest of those three on screen. Your task is to write the missing functions (largest() and smallest ()), which receive the user input as parameters and return the largest and smallest integers, respectively.

Incomplete program:

#include

using namespace std;

int largest(int first, int second, int third);

intsmallest(int first, int second, int third);

int main()

{

int number1, number2, number3, largestnumber,smallestnumber;

cout << "Input the first integer";

cin >> number1;

cout << "Input the second integer:";

cin >> number2;

cout << "Input the third integer:";

cin >> number3;

largestnumber = largest(number1, number2, number3);

smallestnumber =smallest(number1, number2, number3);

cout << "The largest number was " << largestnumber;

cout << " and the smallest " <

Note!

Write the missing functions.

Example output:

Input the first integer:7

Input the second integer:8

Input the third integer:20

The largest number was 20 and smallest 7.

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!