Ask user to enter three numbers (a,b,c). Write a program (c++) that will print the value to the following equations:
a. maximum value of one of these equations (functions separated by commas) (a, a+b, a-c) + maximum of (b, 2b-c, b+2a)
b. maximum value of (3, c+3a, 0) + minimum of (ab-2, 3c, ac)
Define functions max and min which will accept 3 numbers as arguments and return the mix and min of them correspondingly. Use these functions in order to calculate the vaules of the expressions.



=====================================================
#include<iostream>
using namespace std;
//Function prototype
int max(int a,int b,int c);
int min(int a,int b,int c);
int main()
{
int a,b,c;
//Read a,b,c values
cout<<"Enter a value: ";
cin>>a;
cout<<"Enter b value: ";
cin>>b;
cout<<"Enter c value: ";
cin>>c;
//maximum value of one of these equations
(functions separated by commas) (a, a+b, a-c) + maximum of (b,
2b-c, b+2a)
cout<<"\n max(a, a+b, a-c) + max(b, 2b-c, b+2a)
: "<<(max(a, a+b, a-c)+ max(b, 2*b-c,
b+2*a))<<endl;
//maximum value of (3, c+3a, 0) + minimum of
(ab-2, 3c, ac)
cout<<" min(3, c+3a, 0) + min(ab-2, 3c, ac) :
"<<(min(3, c+3*a, 0)+ min(a*b-2, 3*c,
a*c))<<endl;
return 0;
}
//Method to calculate max value of a,b,c
int max(int a,int b,int c)
{
int max;
//Compare a>b
if(a>b)
{
max = a;
}
else
{
max = b;
}
//Finally check with c
if(c>max)
{
max = c;
}
return max;
}
//Method to calculate min of a,b,c
int min(int a,int b,int c)
{
int min;
//Compare a<b
if(a<b)
{
min = a;
}
else
{
min = b;
}
//Finally check with c
if(c<min)
{
min = c;
}
return min;
}
Ask user to enter three numbers (a,b,c). Write a program (c++) that will print the value...
Write a java program that will print if n numbers that the user will input are or not within a range of numbers. For that, your program needs to ask first for an integer number called N that will represent the number of times that will ask for other integer numbers. Right after, it should ask for two numbers that will represent the Min and Max for a range. Lastly. it will iterate N number times asking for an integer...
Write program in C. Please ask the user to determine how many numbers to enter, and then find and display the largest one with two digits. Please call the following two functions in your main functions. void input_numbers(float *data, int num); void find_largest(float *data, int num); Note: In this assignment, please save the entered numbers using pointer, pass the pointer as the arguments. Depending upon the number of elements, the required size is allocated which prevents the wastage of memory....
Create two java programs. The first will ask the user to enter three integers. Once the three integers are entered, ask the user to enter one of three functions. The “average” if they want the average of the three numbers entered, enter “min” if they want the minimum and “max” if they want the maximum. Display the answer. Ask the user if they want to calculate another function for the three numbers. If so, loop and ask what function they...
Write a program that prompts the user for two integers and then prints The sum The difference The product The average The distance (absolute value of the difference) The maximum (the larger of the two) The minimum (the smaller of the two) hint: python defines max and min functions that accept a sequence of values, each separated with a comma. **program must be written in Python**
IN PYTHON. Write a function that ask the user to (a) enter a string, (b) ask the number of time to repeat the string and (c) ask user to input a delimiter to separate them. Call the function and append the test run to your solution. Here is a test run of what is wanted: Enter a string: Ted How many repetitions? 10 Separated by? [}(+ Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted[}(+Ted
This assignment is about data types and condition checking in C++. Ask the user to enter three numbers, one after each other. The numbers can be a decimal numbers (one or two decimal precision, such as 5.4 or 6.32) or integer between 0 and 10. Then find maximum of three numbers and message the user. Examples runs are given below. Example -1 Enter a number: 4.3 Enter a number: 0.5 Enter a number: 6.7 The max of three number: 6.7...
C++ only Write a program that prompts the user for three integers, find the maximum number, their summation and their difference and prints it out to the console. The program must contain at least 3 functions: 1. A finding maximum function: The function will accept three inputs and return the maximum number. 2. A summation function: The function will accept three inputs and return the summation of all three numbers. 3. A subtraction function: The function will accept three inputs...
Write a MIPS Assembly program to accept two numbers A and B from the user. Print all the prime numbers between A and B. Also, check if A and B are prime. If no prime number exits print the string "No prime number between numbers A and B"
use C++ to write the following program.
needs to ask the user for n
The user must put in those 5 values, probably using a for
loop.
NOTE: You can assume the number of values to be entered is
5.
My attempted program below: (not correct, but just a basis)
4. Larger Than n In a program, write a function that accepts three arguments: an array, the size of the array, and a number n. Assume that the array contains...
Please write a C++ program that will accept 3 integer numbers from the user, and output these 3 numbers in order, the sum, and the average of these 3 numbers. You must stop your program when the first number from the user is -7. Design Specifications: (1) You must use your full name on your output statements. (2) You must specify 3 prototypes in your program as follows: int max(int, int, int); // prototype to return maximum of 3 integers...