Programnya
#include <iostream>
using namespace std;
int main()
{
int inputdtk,hari,jm,mnt,detik,detik1,detik2;
cout<<"NAMA = "<<endl;
cout<<"NPM = "<<endl;
cout<<">>>>>>>>>Program
KonversiDetik<<<<<<<<<"<<endl;
cout<<"Input Detik = ";
cin>>inputdtk;
hari = inputdtk/86400;
detik = inputdtk%86400;
jm = detik1/3600;
detik2 = detik1%3600;
mnt = detik2/60;
detik = detik2%60;
cout<<"<<<<<<<<<<Hasil
Konversi>>>>>>>>>>"<<endl;
cout<<hari<<"hari"<<endl;
cout<<jm<<"jm"<<endl;
cout<<mnt<<"mnt"<<endl;
cout<<detik<<"detik"<<endl;
return 0;
}
Algoritma
Deklarasi :
int inputdtk,hari,jm,mnt,detik,detik1,detik2;
Deskripsi :
inputdtk;
hari = inputdtk/86400;
detik1 = inputdtk%86400;
jm = detik1/3600;
detik2 = detik1%3600;
mnt = detik2/60;
detik = detik2%60;
Hasil
Selesai
Comments
Post a Comment