% Script sec2hmsV2
% 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('%8d hr \n%8i min \n%8.2f sec\n', h, m, s)