Advertisement
Guest User

int to void change

a guest
Mar 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void cmmogl ( int a, int b, int c, int d )
  5. {
  6. cout << "a = "; cin >> a;
  7. cout << "b = "; cin >> b;
  8. cout << "c = "; cin >> c;
  9. cout << "d = "; cin >> d;
  10.  
  11. int ogl = 0;
  12.  
  13. while ( a!=0) {
  14. ogl = ogl * 10 + a % 10;
  15. a = a /10;
  16. }
  17. cout << ogl << " ";
  18.  
  19. ogl = 0;
  20. while ( b!=0) {
  21. ogl = ogl * 10 + b % 10;
  22. b = b /10;
  23. }
  24. cout << ogl << " ";
  25. ogl = 0;
  26. while ( c!=0) {
  27. ogl = ogl * 10 + c % 10;
  28. c = c /10;
  29. }
  30. cout << ogl << " ";
  31. ogl = 0;
  32.  
  33. while ( d!=0) {
  34. ogl = ogl * 10 + d % 10;
  35. d = d /10;
  36. }
  37. cout << ogl << " ";
  38.  
  39. }
  40.  
  41.  
  42. int main(){
  43.  
  44. int a,b,c,d;
  45. cmmogl(a,b,c,d);
  46.  
  47.  
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement