Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define TIME_IN_HOUR 60
- int
- main()
- {
- double temperature, time_hours, time_minutes, time_minutes_convert, time_convert;
- printf("Enter time since power failure (Hours then minutes)> ");
- scanf("%lf%lf", &time_hours, &time_minutes);
- /*
- * Just displaying my Hours and Minutes for checking and debugging
- * printf("Hours: %.1f", time_hours);
- * printf(" Debug Minutes: %.2f\n", time_minutes);
- */
- time_minutes_convert = time_minutes / 60.0;
- time_convert = time_hours + time_minutes_convert;
- /*
- * Just displaying my conversion for checking and debugging
- * printf("Debug time since power faulure converting: %.1f\n", time_convert);
- */
- temperature = ((4.0 * (time_convert * time_convert)) / (time_convert + 2.0) - 20.0);
- printf("Temperature in freezer after %.1f", time_convert);
- printf(" hours: %.2f", temperature);
- printf(" degrees celcius.\n");
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement