1.

Program Konversi Detik ke Hari, Jam, Menit, dan Detik
#include "stdafx.h"
#include<iostream.h>
#include<conio.h>
int h,j,m,d,jd,sd,sd2,sd3;
//h=hari, j= jam, m=menit, d=detik, jd=jumlah detik, sd=sisa detik
void main()
{
cout<<"Program Konversi Hari, Jam, Menit, Detik"<<endl;
cout<<"----------------------------------------"<<endl;
cout<<endl;
cout<<"masukkan jumlah detik = ";cin>>jd;
if ((jd/86400)>0)
{
h= jd/86400;
sd= jd-(h*86400);
}
else
{
h=0;
sd= jd;
}
if ((sd/3600)>0)
{
j=sd/3600;
sd2=sd-(j*3600);
}
else
{
j=0;
sd2=sd;
}
if ((sd2/60)>0)
{
m=sd2/60;
sd3=sd2-(m*60);
}
else
{
m=0;
sd3=sd2;
}

cout<<endl;
cout<<h<<" hari "<<j<<" jam "<<m<<" menit "<<sd3<<" detik
"<<endl;
getch();
}