Aniket_Goku

ATM SHORT CODE

Jun 27th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //ATM code in small
  2. #include<stdio.h>
  3. #include<conio.h>
  4. #include<iostream.h>
  5. class atm
  6. {
  7. long int no;
  8. public:
  9. int cal(long int no,int note)
  10. {
  11. int ans=0;
  12. ans=no/note;
  13. no=no-(note*ans);
  14. if(ans!=0)
  15. {
  16. cout<<endl<<note<<" => "<<ans;
  17. }
  18. return no;
  19. };
  20. };
  21. int main()
  22. {
  23. atm n1;
  24. long int no;
  25. clrscr();
  26. cout<<"\nATm System small code\n\n";
  27. cout<<"Enter the Number: ";
  28. cin>>no;
  29. cout<<"==========================";
  30. cout<<"\nnotes => no of notes\n";
  31. no=n1.cal(no,2000);
  32. no=n1.cal(no,500);
  33. no=n1.cal(no,200);
  34. no=n1.cal(no,100);
  35. no=n1.cal(no,50);
  36. no=n1.cal(no,20);
  37. no=n1.cal(no,10);
  38. getch();
  39. return 0;
  40. }
Add Comment
Please, Sign In to add comment