Write a Program to Convert Time in Seconds to Hours, Minutes, and Seconds.
/*Program to Convert Time in Seconds to Hours, Minutes and Seconds*/
long sec, hr, min, t;
printf(“\nEnter time in seconds: “);
hr = sec/3600;
t = sec%3600;
min = t/60;
sec = t%60;
printf(“\n\nTime is %ld hrs %ld mins %ld secs”, hr, min, sec);
What's your reaction?