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!cbosgd!ihnp4!zehntel!hplabs!hao!seismo!brl-tgr!tgr!Harbison@TL-20A.ARPA From: Harbison@TL-20A.ARPA Newsgroups: net.unix-wizards Subject: C puzzle: ~us Message-ID: <6463@brl-tgr.ARPA> Date: Fri, 7-Dec-84 22:20:06 EST Article-I.D.: brl-tgr.6463 Posted: Fri Dec 7 22:20:06 1984 Date-Received: Mon, 10-Dec-84 02:26:48 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". -------