/* minusone.c * Program to illustrate that -1 is represented by another positive integer. Written by: Dan Stearns Date: fall 2000 Notes: short is (almost always) a 16 bit integer. This program assumes 16 bit integers. */ #include main() { short a = 5; /* 65535 is the two's complement representation of -1 in 16 bits */ short b = -1; short c = a + b; printf ("%d%s%d%s%d\n",a, " + ", b, " = ", c); } /* Program output 5 + -1 = 4 */