Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. bool isEqual(int x, int y)
  2. {
  3. return (x == y);
  4. }
  5. int main()
  6. {
  7. cout << "Enter a value:\t\t ";
  8. int x;
  9. cin >> x;
  10.  
  11. cout << "Enter another value:\t ";
  12. int y;
  13. cin >> y;
  14.  
  15. if (isEqual(x, y))
  16. cout << "Numbers were equal!" << endl;
  17. else
  18. cout << "Numbers were not equal" << endl;
  19.  
  20. bool bZero(1);
  21.  
  22. if (x == 0)
  23. bZero = 1;
  24. else
  25. if (y == 0)
  26. bZero = 1;
  27. else
  28. bZero = 0;
  29.  
  30. if (bZero == 1)
  31. cout << "One of numbers was 0" << endl;
  32. else
  33. return 0;
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement