Computers and Technology

Given 4 integers, output their product and their average, using integer arithmetic.
Ex: If the input is:
8 10 5 4
the output is:
1600 6
Note: Integer division discards the fraction. Hence the average of 8 10 5 4 is output as 6, not 6.75.
Note: The test cases include four very large input values whose product results in overflow. You do not need to do anything special, but just observe that the output does not represent the correct product (in fact, four positive numbers yield a negative output; wow).
Also output the product and average, using floating-point arithmetic. Output each floating-point value with three digits after the decimal point, which can be achieved by executing cout << fixed << setprecision(3); once before all other cout statements.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:30, Margieeee
Asalesman at a high end computer security firm want to sell you a proactive cover for your passport, which contains an rfid tag inside storing your sensitive information. the salesperson's solution cost only $79.99 and protects your passport from being read via radio waves while it is in your pocket. explain how you can achieve the same thing under $3.00
Answers: 3
image
Computers and Technology, 22.06.2019 03:30, brin1021
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
image
Computers and Technology, 24.06.2019 03:40, Eylul30
4. does the kernel phenotype distribution support the idea that the cob is the result of a dihybrid cross? what information supports your answer? if a dihybrid cross (i. e. f1 to f2 of standard mendelian crosses) is not indicated what conditions might contribute to this finding.
Answers: 2
image
Computers and Technology, 24.06.2019 10:10, juliana0122
Scanning the road can be thought of as a
Answers: 2
Do you know the correct answer?
Given 4 integers, output their product and their average, using integer arithmetic.
Ex: If th...

Questions in other subjects:

Konu
Mathematics, 28.10.2020 20:00
Konu
Biology, 28.10.2020 20:00
Konu
Biology, 28.10.2020 20:00
Konu
Biology, 28.10.2020 20:00