#include <stdio.h>
int main() {
int num = 4562; // Original number
int reversed = 0;
printf("Original number: %d\n", num
);
while (num != 0) {
int digit = num % 10; // Extract the last digit
reversed = reversed * 10 + digit; // Append the digit to the reversed number
num = num / 10; // Remove the last digit
}
printf("Reversed number: %d\n", reversed
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBudW0gPSA0NTYyOyAvLyBPcmlnaW5hbCBudW1iZXIKICAgIGludCByZXZlcnNlZCA9IDA7CgogICAgcHJpbnRmKCJPcmlnaW5hbCBudW1iZXI6ICVkXG4iLCBudW0pOwoKICAgIHdoaWxlIChudW0gIT0gMCkgewogICAgICAgIGludCBkaWdpdCA9IG51bSAlIDEwOyAgICAgICAvLyBFeHRyYWN0IHRoZSBsYXN0IGRpZ2l0CiAgICAgICAgcmV2ZXJzZWQgPSByZXZlcnNlZCAqIDEwICsgZGlnaXQ7IC8vIEFwcGVuZCB0aGUgZGlnaXQgdG8gdGhlIHJldmVyc2VkIG51bWJlcgogICAgICAgIG51bSA9IG51bSAvIDEwOyAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIGxhc3QgZGlnaXQKICAgIH0KCiAgICBwcmludGYoIlJldmVyc2VkIG51bWJlcjogJWRcbiIsIHJldmVyc2VkKTsKCiAgICByZXR1cm4gMDsKfQo=