Advertisement
Guest User

Division

a guest
Mar 25th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9.     division(20, 4);
  10. }
  11.  
  12. void division(int x, int y)
  13. {
  14.     for(int i = 1; i < x; i++)
  15.     {
  16.         if( (x - (y*i)) <= 0)
  17.         {
  18.         std:: cout << "El cociente es : " << (y*(i-1)) << endl;
  19.         std:: cout << "El resto es :  " << x - (y*(i-1)) << endl;
  20.         }
  21.     }  
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement