Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!wivax!cadmus!harvard!seismo!brl-tgr!tgr!Harbison@TL-20A.ARPA From: Harbison@TL-20A.ARPA Newsgroups: net.unix-wizards Subject: C puzzle: ~us Message-ID: <6546@brl-tgr.ARPA> Date: Sun, 9-Dec-84 08:23:10 EST Article-I.D.: brl-tgr.6546 Posted: Sun Dec 9 08:23:10 1984 Date-Received: Thu, 13-Dec-84 02:01:15 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 10 What should the following program print, assuming "short" is implemented in 16 bits and "int" in 32 bits, using standard two's complement representation? main(){ unsigned short x = 0xfffe; printf("%8x\n", ~x) } Hint: Your choices are "1" or "ffff0001". -------