a runner runs 14 kılometers in 45 minutes and 30 sec-
onds. Write a program that displays the average speed in miles per hour. (Note that
1 mile is 1.6 kilometers.)
Exact correspondence to the task:
#include <stdio.h>
int main()
{
int kil=14;
int min=45;
int sec=30;
double speed;
speed = (double)(((kil*3600)/((min*60)+sec))/1.6);
printf("The average speed: %.2f miles per hour", speed);
}
Comments
Leave a comment