#include <stdio.h> #include <stdint.h> #define POS_SET_1 2 #define POS_SET_2 7 #define POS_CLEAR 3 #define POS_TOGGLE 5 uint8_t modify_register(uint8_t reg) { reg |= (1 << POS_SET_1); reg |= (1 << POS_SET_2); reg &= ~(1 << POS_CLEAR); reg ^= (1 << POS_TOGGLE); return reg; } int main() { uint8_t reg; scanf("%hhu", ®); printf("%u", modify_register(reg)); return 0; }
Test Cases
Test Results
Input
0
Expected Output
164