Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int x, y;
  4. int *coderoare;
  5.  
  6.  
  7. int read_data()
  8. {
  9. cout << "x = "; cin >> x;
  10. cout << "y = "; cin >> y;
  11. }
  12.  
  13.  
  14. int checkerr(int a, int b)
  15. {
  16. if((a > INT_MAX) && (b > INT_MAX))
  17. {
  18. *coderoare = 1;
  19. }
  20. }
  21.  
  22. int adunare(int a, int b)
  23. {
  24. int *p1;
  25. int *p2;
  26. p1 = &a;
  27. p2 = &b;
  28. cout << x << " + " << y << " = " << *p1 + *p2 << " err = " << coderoare;
  29. }
  30.  
  31.  
  32.  
  33. int main()
  34. {
  35. read_data();
  36. checkerr(x,y);
  37. adunare(x,y);
  38. }
  39. //cadou18
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement