#include <stdio.h> #include <stdint.h> uint32_t rotate_right(uint32_t reg, unsigned int n) { n = n % 32; return (reg >> n) | (reg << (32 - n)); } int main() { uint32_t reg, n; scanf("%u %u", ®, &n); // read decimal input uint32_t result = rotate_right(reg, n); printf("%u\n", result); // print in decimal return 0; }
Test Cases
Test Results
Input
2147483648 1
Expected Output
1073741824