I want you to figure the mistake I am doing. suppose I'm taking distance=300 and speed=80 then I should get the answer as 3 hours 44 minutes and 27n seconds, but I'm not getting that, instead I'm getting 3 hours 45 min and 2700 sec. please resolve my issue.
#include <stdio.h>
int main()
{
//calculate the time taken to reach from city A to city B.
int distance, speed;
int time, D;
float speedInMinutes;
int TimeInMinutes;
float speedInSec, TimeInSec;
printf("Distance between the two cities A and B= ");// unit- Km
scanf("%d", &distance);
printf("Speed of the car= ");// unit- km/h
scanf("%d", &speed);
time=distance/speed;// unit- hr
speedInMinutes=speed/60.0;
TimeInMinutes=(distance%speed)/speedInMinutes;
speedInSec=speed/3600.0;
TimeInSec=(distance%speed)/speedInSec;
printf("Time taken by the card to reach city B from city A= %d hours %d minutes %0.0f sec\n", time, TimeInMinutes, TimeInSec);
return 0;
}