Advertisement
fr3s7ed

Untitled

Oct 15th, 2018
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. include <stdio.h>
  2.  
  3. int xor (int x, int y);
  4.  
  5. int main()
  6. {
  7. int x;
  8. int y;
  9. printf ("Please enter the first number you'd like to XOR:\n");
  10. scanf ("%x", &x);
  11. getchar();
  12. printf ("Please enter the second number you'd like to XOR:\n");
  13. scanf ("%x", &y);
  14. getchar();
  15. printf ("The XOR value of the 2 numbers is: %x\n" ,xor (x,y));
  16. getchar();
  17. }
  18.  
  19. int xor (int x, int y)
  20. {
  21. return x ^ y;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement