short sho1, sho2;
printf("Enter two shorts.\n");
scanf("%hd %hd", &sho1, &sho2);
printf("%hd^%hd is %hd.\n", sho1, sho2, sho1^sho2);
When I enter '2 2', I get this output:
2^2 is 0.
How come? I'm using the MinGW GCC compiler in Eclipse, in case that's of any importance.