Integer division discards the fraction hence the average of


Variables/Assignments: Simple statistics

challenge

activity

2.14.1: Simple statistics.

Start

Part 1

Given 3 integers, output their average and their product, using integer arithmetic.

Ex: If the input is 10 20 5, the output is:

11 1000

Note: Integer division discards the fraction. Hence the average of 10 20 5 is output as 11, not 11.666666666666666.

Submit the above for grading. Your program will fail the test cases (which is expected), until you complete part 2 below but check that you are getting the correct average and product using integer division.

Part 2

Also output the average and product, using floating-point arithmetic.

Ex: If the input is 10 20 5, the output is:

11 1000

11.666666666666666 1000.0

Solution Preview :

Prepared by a verified Expert
Business Management: Integer division discards the fraction hence the average of
Reference No:- TGS02936519

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)