Given two int variables distance and speed, write an expression that divides distance by speed using floating point arithmetic, i.e., a fractional result should be produced. (NOTE: Simply write an expression that performs the calculation. Do not assign the result to a variable.)

Respuesta :

Answer:

float(distance) / speed

Explanation:

Given the variable distance and speed in a program that hold a integer value respectively.  We can perform the division between the two variable using / operator. Since both distance and speed are integers, we need to convert one of them to float type to perform the floating point arithmetic. Otherwise the division output will be rounded up to the nearest integer which is not a desired result.