#include <stdio.h> int toggleFifthBit(int n) { // Write your code here int i; int pos=5; for(i=0;i<=31;i++) { if(i==pos) { n=n^1<<pos; } } return n; } int main() { int n; scanf("%d", &n); printf("%d", toggleFifthBit(n)); return 0; }
Test Cases
Test Results
Input
8
Expected Output
40