Contoh Program C - #5 Konversi Detik ke Hari
#include <stdio.h>
int mt,w,d,h,m,s,modmt,modw,modd,modh;
main(int n)
{
scanf("%d",&n);
if (n>3600){
mt=n/18144000;
modmt=n%18144000;
w=modmt/604800;
modw=n%604800;
d=modw/86400;
modd=n%86400;
h=modd/3600;
modh=modd/3600;
m=modh/60;
s=modh%60;}
else
m=n/60;
s=n%60;
printf("%d Bulan, %d Minggu, %d Hari, %d Jam, %d Menit, %d Detik",mt,w,d,h,m,s);
}
int mt,w,d,h,m,s,modmt,modw,modd,modh;
main(int n)
{
scanf("%d",&n);
if (n>3600){
mt=n/18144000;
modmt=n%18144000;
w=modmt/604800;
modw=n%604800;
d=modw/86400;
modd=n%86400;
h=modd/3600;
modh=modd/3600;
m=modh/60;
s=modh%60;}
else
m=n/60;
s=n%60;
printf("%d Bulan, %d Minggu, %d Hari, %d Jam, %d Menit, %d Detik",mt,w,d,h,m,s);
}
Komentar
Posting Komentar
Yuk saling mengisi kekurangan setiap orang :), Kritik dan saran selalu diterima kok! :)