/

Tuesday, October 24, 2017

Program Konversi Jam, menit, detik menjadi satuan total detik

Contoh Program Konversi Jam, menit, detik menjadi satuan total detik dalam bahasa C++

#include <iostream>
#include <conio>

main()
{
cout <<" Dibuat oleh Ervan Pangestu "<< endl;
cout <<" NIM -------- "<< endl;
cout <<"  "<< endl;
typedef struct {long int hh; //jam
               long int mm; //menit
               long int ss //detik
               } Jam;
Jam J;
long int Jumlah ;
cout <<"Jam:";cin>>J.hh;
cout <<"Menit:";cin>>J.mm;
cout <<"Detik:";cin>>J.ss;

Jumlah = (J.hh 3600)+(J.mm*60)+J.ss
cout<<"Jumlah Detik ="<<Jumlah<< endl;
cout<<""<< endl;
cout<<"Press any key to close"<< endl;

getch ();
}

Hasil :

Note : Program sepenuhnya belum sempurna, berusahalah untuk mencari kesalahannya

No comments:

Post a Comment

Chord Virgoun - Cinta Tak Dianggap

Virgoun - Cinta Tak Dianggap Intro : G Em              C            G     D      Caraku tuk menjaga hatiku Em             C            ...