Advertisement
muhammadrefa

Umur

Feb 20th, 2013
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.73 KB | None | 0 0
  1. {Untested!}
  2.  
  3. program umur;
  4. uses crt;
  5. var TglLhr,BlnLhr,ThnLhr,TglSkrg,BlnSkrg,ThnSkrg,Umur:integer;
  6. begin
  7.     write('Tanggal Lahir : '); readln(TglLhr);
  8.     write('Bulan Lahir   : '); readln(BlnLhr);
  9.     write('Tahun Lahir   : '); readln(ThnLhr);
  10.     writeln;
  11.  
  12.     write('Tanggal Sekarang : '); readln(TglSkrg);
  13.     write('Bulan Sekarang   : '); readln(BlnSkrg);
  14.     write('Tahun Sekarang   : '); readln(ThnSkrg);
  15.     writeln;
  16.    
  17.         {Proses}
  18.         Umur:=((ThnSkrg*365)+(BlnSkrg*30)+TglSkrg)-((ThnLhr*365)+(BlnLhr*30)+TglSkrg);
  19.        
  20.     writeln('Jadi usia dalam satuan hari = ',Umur);
  21.     writeln;
  22.    
  23.     writeln('Catatan :');
  24.     writeln('1 tahun = 365 hari');
  25.     writeln('1 bulan = 30 hari');
  26.     writeln;
  27.    
  28.     write('Tekan Enter untuk keluar...'); readln; clrscr;
  29. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement