#include <stdio.h>
union A {
char c[4];
int x;
};
int main() {
union A a;
a.x = 65536;
// x86 is little endian
printf("%d %d %d %d\n", a.c[4], a.c[3], a.c[2], a.c[1]);
a.x = a.x >> -1;
printf("%d %d %d %d\n", a.c[4], a.c[3], a.c[2], a.c[1]);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: