Make a program that will ask the users to input 4 different numbers. After the userâ€™s input the program will display the formula on the next line. Next line would be the presentation of the formula which the variables were substituted by the inputs from the user, then returns the average of the numbers entered.
**All inputs are integers except average which is float with two decimal places.
I'm guessing you were given a formula that you need to implement. Something like c = a + b or c = a^(b+C). If not, then you have an ambiguous prompt and should talk to whoever gave it to you.
However, if I were to make a complete shot in the dark that I may be completely wrong about, the formula they want you to display and implement is for a 4-value mean average ((a+b+c+d)/4, note that copy-pasting this into your program will not produce a desired result). The reason I think this is because you are asked to have a floating-point (decimal) variable named "average" and the program is supposed to return the average of the numbers entered.
**All inputs are integers except average which is float with two decimal places.
This means that:
1 2 3 4 5 6
float num1,num2,num3,num4,result;
// should be
int num1, num2, num3, num4;
float result;
The way you compute the result is wrong.
You should remember from mathematics that multiplication and division have precedence over addition and subtraction.