#include <stdio.h> int toggleFifthBit(int n) { n ^= (1 << 5); // n = 0b00001010 or 0b00010000 = 0b00011010; return n ; } int main() { int n = 10; scanf("%d", &n); printf("%d", toggleFifthBit(n)); return 0; }
Test Cases
Test Results
Input
8
Expected Output
40