All submissions

Code

#include <stdio.h>

int toggleFifthBit(int n) {
    // Write your code here
    n ^= (1 << 5);
    return n; 
}

int main() {
    int n;
    scanf("%d", &n);
    printf("%d", toggleFifthBit(n));
    return 0;
}

Solving Approach

Toggle a bit by xoring with '1'. shift the 1 by required amount and get the bit toggled.

 

 

Loading...

Input

8

Expected Output

40