• Source
    1. #include<stdio.h>
    2. int main()
    3. {
    4. int bit1,bit2;
    5. printf("Enter the 1st bit : ");
    6. scanf("%d",&bit1);
    7. printf("\nPlease, Enter the 2nd bit : ");
    8. scanf("%d",&bit2);
    9. if(bit1==0||bit1==1&&bit2==0||bit2==1)
    10. {
    11. if(bit1==bit2)
    12. {
    13. printf("\n\nThe result is %d XOR %d = 0",bit1,bit2);
    14. }
    15. else
    16. {
    17. printf("\n\nThe result is %d XOR %d = 1",bit1,bit2);
    18. }
    19. }
    20. else
    21. {
    22. printf("\n\nSorry, You have entered wrong choice/value.");
    23. }
    24. return 0;
    25. }