Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ATM code in small
- #include<stdio.h>
- #include<conio.h>
- #include<iostream.h>
- class atm
- {
- long int no;
- public:
- int cal(long int no,int note)
- {
- int ans=0;
- ans=no/note;
- no=no-(note*ans);
- if(ans!=0)
- {
- cout<<endl<<note<<" => "<<ans;
- }
- return no;
- };
- };
- int main()
- {
- atm n1;
- long int no;
- clrscr();
- cout<<"\nATm System small code\n\n";
- cout<<"Enter the Number: ";
- cin>>no;
- cout<<"==========================";
- cout<<"\nnotes => no of notes\n";
- no=n1.cal(no,2000);
- no=n1.cal(no,500);
- no=n1.cal(no,200);
- no=n1.cal(no,100);
- no=n1.cal(no,50);
- no=n1.cal(no,20);
- no=n1.cal(no,10);
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment