Advertisement
vencinachev

XOR

Mar 2nd, 2022
1,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, char **argv){
  4.     if (argc != 3){
  5.         fprintf(stderr, "Invalid arguments!\n");
  6.         return EXIT_FAILURE;
  7.     }
  8.     int a = atoi(argv[1]);
  9.     int b = atoi(argv[2]);
  10.     /*if ((!a && b) || (a && !b)){
  11.         printf("1\n");
  12.     } else {
  13.         printf("0\n");
  14.     }*/
  15.     printf("%d\n", (!a && b) || (a && !b));
  16.     return EXIT_SUCCESS;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement