Name: Deab Sina
Major: D4 TMD ITB Batch 6
This is my video assignment about exchange rate from Rupiah to Dollas.
Coding :
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
// latihan 4
int rup, kurs,dol,sisa;
printf("Masukkan nilai rupiah: ");
scanf_s("%d",&rup);
printf("\n");
printf("Masukkan kurs rupiah thd US$ : ");
scanf_s("%d",&kurs);
printf("\n");
dol = rup / kurs; // We input rup = 10000, and kurs = 7500
// dol = rup / kure
// = 10000 / 7500 = 1.3333 or dol =1
sisa = rup % kurs;
// sisa = 10000 Mod 7500 = 2500
printf("Hasil penukaran:\n");
printf("Nilai Dolar: %d\n", dol);
printf("Sisa: %d\n", sisa);
printf("\n");
system("pause");
return 0;
}
Output :
This is the link to my video: http://youtu.be/075cDjQcj0M
Thanks,
No comments:
Post a Comment