% Script sec2hms
% Display user-entered value of seconds as hr-min-sec

disp('Convert seconds to hour-minute-second')

seconds= input('How many seconds? ');
h= floor(seconds/60/60);
s= rem(seconds, 60*60);
m= floor(s/60);
s= rem(s, 60);

fprintf('%f seconds ', seconds)
fprintf('is the same as \n')
fprintf('%d hr, %i min, and %.2f sec\n', h, m, s)