Total Seconds Conversion Program to Hour with Pascal  

Posted by: DK in ,

Still practicing with the pascal programming language, in practice this time, I will create a program to convert the total number of seconds to hours, this program was made at the request of my blog readers who enter your e-mail, complete the following source code:

Program Konversi_Total_detik_ke_Jam;

type Jam=record
hh:longint; {0..23}
mm:longint; {0..59}
ss:longint; {0..59}
end;
var
J:Jam;
total_detik:longint;
sisa:longint;

Begin
Write (’Total detik = ‘); readln (total_detik);
J.hh:=total_detik div 3600;
sisa:=total_detik mod 3600;
J.mm:=sisa div 60;
J.ss:=sisa mod 60;
Write (J.hh,’ : ‘,J.mm,’ : ‘,J.ss);
Readln;
end.
Copyright © Dede Kurniadi

This entry was posted on Monday, August 24, 2009 and is filed under , . You can leave a response and follow any responses to this entry through the Subscribe to: Post Comments (Atom) .

0 comment

Post a Comment