#include <stdio.h> #include <stdint.h> int main() { uint32_t reg; scanf("%u", ®); // DECIMAL input uint32_t field = (reg >> 10) & 0x1F; // Extract bits 10–14 if (field < 31) { field++; } reg &= ~(0x1F << 10); // Clear bits 10–14 reg |= (field << 10); // Write updated field printf("%u", reg); // DECIMAL output return 0; }
Test Cases
Test Results
Input
15360
Expected Output
16384