Question: / / LargeSmall.cpp - This program calculates the largest and smallest of three integer values. #include using namespace std; int main ( ) { /

// LargeSmall.cpp - This program calculates the largest and smallest of three integer values.
#include
using namespace std;
int main()
{
// Declare and initialize variables here
int largest; // Largest of the three values
int smallest; // Smallest of the three values
int firstNumber =-50;
int secondNumber =53;
int thirdNumber =78;
// Write assignment, if, or if else statements here as appropriate
// Output largest and smallest number.
cout << "The largest value is "<< largest << endl;
cout << "The smallest value is "<< smallest << endl;
return 0;
}
Two variables named largest and smallest are declared for you. Use these variables to store the largest and smallest of the three integer values. Three variables have been declared for you firstNumber, secondNumber, thirdNumber. You must decide what other variables you will need and initialize them as appropriate.
Task 1: Write the rest of the program using assignment statements, if statements, or if else statements as appropriate. There are comments in the code that tell you where you should write your statements.The output statements are written for you.
An example of the program is shown below:
The largest value is 78 The smallest value is -50

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 Programming Questions!