Hello I am new to C and was wondering if someone could just please explain to me what this function does? Thats all I just need help understanding it. I'm new to C so some one the syntax is tough for me to understand and Im not sure what the function does overall.
Thanks
#include <stdio.h>
unsigned int mystery2(unsigned int n) {
unsigned int temp =
(n >> 24) |
((n << 8) & 0x00FF0000) |
((n >> 8) & 0x0000FF00) |
(n << 24);
return temp;
}
unsigned int prompt_and_read() {
unsigned int next;
printf("\nprompt> Please enter an integer (0 to exit): ");
scanf("%u", &next);
if (next == 0) exit(0);
return next;
}
int main() {
while (1) {
unsigned int next = prompt_and_read();
unsigned int result = mystery(next);
printf("%d ===> %d\n", next, result);
}
return 0;
}