Do not go where the path may lead,
go instead where there is no path
and leave a trail...

17 November 2012

Satu Situasi


#include<iostream>
using namespace std;

void main(){


float amount, newamount;
int fiftycent, twentycent, seposen;

cout<<"Your input : RM ";
cin>>amount;

newamount = amount*100;
fiftycent = newamount/50;
twentycent = (newamount-(fiftycent*50))/20;
seposen = (newamount-((fiftycent*50)+(twentycent*20)))/10;


cout<<fiftycent <<" pieces of 50 cent"<<endl;
cout<<twentycent <<" pieces of 20 cent"<<endl;
cout<<seposen <<" pieces of 10 cent"<<endl;
}

No comments:

Post a Comment