Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gwsd.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittvax!dcdwest!sdcsvax!gwsd!keith From: keith@gwsd.UUCP (Keith OHara) Newsgroups: net.micro.att Subject: What's wrong with this program (3b2)? Message-ID: <104@gwsd.UUCP> Date: Fri, 14-Jun-85 17:31:34 EDT Article-I.D.: gwsd.104 Posted: Fri Jun 14 17:31:34 1985 Date-Received: Sun, 16-Jun-85 01:27:49 EDT Organization: Gateway Computer Systems, San Diego Lines: 39 [] The following program came out of the K&R book, page 8. When compiled on a 3b2 (SYS-V.2)... $ cc -g temperature.c $ a.out Illegal instruction - core dumped $ sdb a.out main:15: fahr = lower; *q -----program follows----- #include /* print Fahrenheit-Celsius table for f = 0,20,...,300 */ main() { int lower, upper, step; float fahr, celsius; lower = 0; /*lower limit of temperature table */ upper = 300; /*upper limit */ step = 20; /* step size */ fahr = lower; while (fahr <= upper) { celsius = (5.0/9.0) * (fahr-32.0); printf("%4.0f %6.1f\n",fahr,celsius); fahr = fahr + step; } } -------end of file------- If I'm missing a semicolon or something, I'll feel like a fool... Keith - {sdcsvax|sdcc3}!gwsd!keith