0
Write a program that will multiply the sum of 5 and 6 by 57.3 and output the result. how to code tjis
3 odpowiedzi
+ 2
sum of 5 and 6 means 5+6 .
Now multiply that sum by 57.3 .
+ 1
It is incorrect due to the order of operations. What you have written, will take 7 * 57.3 and then add 5. Your parenthesis are in the wrong place based on the description.
Run it both ways.. in the code of your choice
Console.Write("(5 + 6 * (57.3)) = ");
Console.WriteLine(5 + 6 * (57.3));
Console.Write("(5 + 6) * 57.3 = ");
Console.WriteLine((5 + 6) * 57.3);
The first calculation will be 348.79999999999995
The 2nd calculation will be 630.3
https://www.mathsisfun.com/operation-order-pemdas.html
0
print ( 5 + 7 *(57.3))
is wrong then how??