Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- signed short int years = 1;
- const unsigned short int daysInYear = 365;
- signed short int days = 0;
- const int daysInHours = 24;
- unsigned int totalHoursPerYear = 0;
- const int minPerHour = 60;
- unsigned short int totalHour = 0;
- const int totalSecPerHour = 60;
- unsigned int totalSec = 0;
- days = years * daysInYear;
- totalHoursPerYear = days * daysInHours;
- totalHour = totalHoursPerYear * minPerHour;
- totalSec = totalHour * totalSecPerHour;
- printf("days : %d\n", days);
- printf("hours : %d\n", totalHoursPerYear);
- printf("mins : %d\n", totalHour);
- printf("secs : %d\n", totalSec);
- return 0;
- }
Add Comment
Please, Sign In to add comment