asked 163k views
5 votes
Calculate the average (as a double) of the values contained in the integer variables num1, num2, num3 and assign that average to the double variable avg. assume the variables num1, num2, and num3 have been declared and assigned values, and the variable avg declared.

asked
User Flaky
by
7.8k points

1 Answer

5 votes
avg = ( num1 + num2 + num3 ) / 3;
answered
User Obcure
by
8.4k points