C++ program
A cashier has currency notes of denominations 10, 50 and 100. If the amount to be withdrawn is input through the keyboard in hundreds, find the total number of currency notes of each denomination the cashier will have to give to the withdrawer.
Write a program in c++ code:
Source code:
#include<iostream>// iostream provides basic
// input and output services for C++ programs
using namespace std;
int main()// Th execution of program start with the main function
{
int amount,R100,R50,R10,R1;
cout<<"Please input amount for withdraw : ";
// cout is used to display the same statement in the output.
cin>>amount;//Cin used to enter a value by the user.
//calculations
R100=amount/100;
amount=amount%100;
R50=amount/50;
amount=amount%50;
R10=amount/10;
amount=amount%10;
cout<<"\n\nRequired notes of Rs. 100 : "<<R100;
cout<<"\n\nRequired notes of Rs. 50 : "<<R50;
cout<<"\n\nRequired notes of Rs. 10 : "<<R10;
return 0;
}
0 Comments