C++ Pemecah Uang

#include<iostream>
#include<conio.h>
#include<math.h>
int main(){
int a,b,c,d,e,f;
cout<<"\n    =======================\n";
cout<<"    ===> PEMECAH UANG <====\n";
cout<<"    =======================\n\n";
cout<< " Berapa uang yang akan di pecahkan : Rp. ";
cin >> a;
b=a/1000;
c=(a%1000)/500;
d=(a%1000%500)/100;
e=(a%1000%500%100)/50;
f=(a%1000%500%100%50)/25;
cout<<"\n  !!!!!!!!!!!\n";
cout<<"  !! HASIL !!\n";
cout<<"  !!!!!!!!!!!\n\n";

cout<<"    "<<b<<" Buah pecahan Rp. 1000\n";
cout<<"    "<<c<<" Buah pecahan Rp. 500\n";
cout<<"    "<<d<<" Buah pecahan Rp. 100\n";
cout<<"    "<<e<<" Buah pecahan Rp. 50\n";
cout<<"    "<<f<<" Buah pecahan Rp. 25\n";
getch();
}

0 Response to "C++ Pemecah Uang"

Posting Komentar