Share this topic on Del.icio.usShare this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on SlashdotShare this topic on StumbleUponShare this topic on TechnoratiShare this topic on TwitterShare this topic on YahooShare this topic on Google buzz

Author Topic: Ekivalensi menit terhadap jam  (Read 1111 times)

0 Members and 1 Guest are viewing this topic.

Offline cyclon

  • Global Moderator
  • *
  • Posts: 185
  • Reputasi: 31

  • Aktivitas bulan ini
    0%
    • Indonesian Informatics Online Community
Ekivalensi menit terhadap jam
« on: 20 October 2008, 12:38:47 »
Kode berikut menampilkan nilai ekivalensi dari menit ke jam, bisa juga disebut sebagai konversi.

Code: (php) [Select]
<?php
function hitung($jam$min) {
if (($min-60) < 0) {
  $total "$jam:$min";
  echo $total;
}
else {
  $min -= 60;
  $jam += 1;
  hitung($jam$min);
}
}
hitung(5,356);
?>


Dalam fungsi terpanggil hitung(5,356) , 5 berarti 5 jam dan 356 berarti 356 menit.

Nilai tersebut ekivalen dengan: 10:56, yaitu 10 jam 56 menit  :D
« Last Edit: 31 March 2009, 12:33:14 by 1nf0rm4t1c5 »
RAR Password di file: http://if.web.id

Forum Informatika

Ekivalensi menit terhadap jam
« on: 20 October 2008, 12:38:47 »
Sponsored Links: