time = input('Enter (24 hour) time [h m s]: ');
h = time(1);
m = time(2);
s = time(3);
ampm = ['AM';'PM'];

while true
   for h = h:23
      for m = m:59
         for s = s:59
            clc
            fprintf('\n\n\n\n\n\n            %2d:%02d:%02d %s\n', mod(h+11,12)+1, m, s, ampm((h>11)+1,:))
            pause(0.5)
            clc
            fprintf('\n\n\n\n\n\n            %2d %02d %02d %s\n', mod(h+11,12)+1, m, s, ampm((h>11)+1,:))
            pause(0.5)
         end
         s = 0;
      end
      m = 0;
   end
   h = 0;
end
