#include <stdio.h> int toggleFifthBit(int n) { // Write your code here n ^= (0x01 << 5); return n; } int main() { int n; scanf("%d", &n); printf("%d", toggleFifthBit(n)); return 0; }
Just using the Bit-wise Ex-OR on the 5th Bit of n to manipulate the current number
Test Cases
Test Results
Input
8
Expected Output
40