2. Bit Toggle

Back To All Submissions
Previous Submission
Next Submission

Code

#include <stdio.h>

int main() {
    int N;

    // nhập số nguyên
    scanf("%d", &N);

    // lật bit thứ 5 (index 0)
    N = N ^ (1 << 5);

    // in kết quả
    printf("%d", N);

    return 0;
}

Solving Approach

 

 

 

Was this helpful?
Upvote
Downvote