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