MENENTUKAN JUMLAH MATA UANG

#include<conio.h>

#include<iostream.h>

int main ()

{

long int a,b,c,d,e,f,g,h,i,j,k,hasil;

b=100000,c=50000,d=20000,e=10000,f=5000,g=1000,h=500,i=100,j=50;

cout<<“Masukkan Bilangan                         = ” ;cin>>a;

cout<<endl;

hasil=a/b;

cout<<“Jumlah Ratusan Ribu                      = ” <<hasil;

cout<<endl;

hasil=(a%b)/c;

cout<<“Jumlah Lima puluhan Ribu = ” <<hasil;

cout<<endl;

hasil=(a%b%c)/d;

cout<<“Jumlah dua puluhan Ribu    = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d)/e;

cout<<“Jumlah sepuluhan Ribu                   = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e)/f;

cout<<“Jumlah Lima Ribu                = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e%f)/g;

cout<<“Jumlah seRibuan                 = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e%f%g)/h;

cout<<“Jumlah Lima Ratusan                      = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e%f%g%h)/i;

cout<<“Jumlah Ratusan                               = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e%f%g%h%i)/j;

cout<<“Jumlah Lima puluhan                       = ” <<hasil;

cout<<endl;

hasil=(a%b%c%d%e%f%g%h%i%j);

cout<<“Jumlah Satuan                                 = ” <<hasil;

getch ();

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: