Question
modifty this program // Bradley Bush #include using namespace std; int main() { int num1, num2, num3, smallest, largest; cout < < Input three different
modifty this program
// Bradley Bush
#include
using namespace std;
int main()
{
int num1, num2, num3, smallest, largest;
cout << "Input three different integers: ";
cin >> num1 >> num2 >> num3; // input
largest = num1;
if ( num2 > largest )
largest = num2;
if ( num3 > largest )
largest = num3;
smallest = num1;
if ( num2 < smallest )
smallest = num2;
if ( num3 < smallest )
smallest = num3;
cout << "Sum is " << num1 + num2 + num3
<< " Average is " << (num1 + num2 + num3) / 3
<< " Product is " << num1 * num2 * num3
<< " Smallest is " << smallest
<< " Largest is " << largest << endl;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started