Friday, 5 October 2012
Program konversi hari, tahun, jam, menit, detik
# include <stdio.h>
void main(){
int tahun,bulan,hari,d,detik,menit,jam,Hari;
printf("==== Tugas Pemrograman ==== \n");
printf("==== WULAN NOVITASARI ==== \n");
printf("==== 7410030818 ==== \n\n\n");
printf("Umur Andi\n");
printf ("Tahun\t= ");
scanf ("%d", &tahun);
printf("Bulan \t= ");
scanf ("%d", &bulan);
printf("Hari \t= ");
scanf ("%d", &hari);
printf("*************************\n\n\n\n");
detik=((tahun*365)+(bulan*30)+hari)*24*3600;
menit=((tahun*365)+(bulan*30)+hari)*24*60;
jam=((tahun*365)+(bulan*30)+hari)*24;
Hari=((tahun*365)+(bulan*30)+hari);
printf("Maka Umur Andi dalam ---> \n");
printf("Detik = %d\n",detik);
printf("Menit = %d\n",menit);
printf("Jam = %d\n",jam);
printf("Hari = %d\n",Hari);
}
Labels:
C++,
materi kuliah
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment