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 did it happen? I use the MinGW GCC compiler in Eclipse, if that matters.
source
share