From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,FROM_WORDY, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b50bc6538a649497 X-Google-Attributes: gid103376,public From: "Ken Garlington" Subject: Re: if statements Date: 2000/11/08 Message-ID: #1/1 X-Deja-AN: 691198428 References: <3A02CED4.520C2768@brighton.ac.uk> <3A078B6F.D34B024B@erols.com> <8mTN5.7821$pq3.603668@news.flash.net> <3A0824BB.14ACCA12@bton.ac.uk> <4x5O5.8364$pq3.657453@news.flash.net> <3A094717.AAF0EB30@bton.ac.uk> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 973691346 216.215.73.67 (Wed, 08 Nov 2000 07:49:06 CST) Organization: FlashNet Communications, http://www.flash.net X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 08 Nov 2000 07:49:06 CST Newsgroups: comp.lang.ada Date: 2000-11-08T00:00:00+00:00 List-Id: "John English" wrote in message news:3A094717.AAF0EB30@bton.ac.uk... : > "Exercise 4.1: Write an if statement which will swap the values of : > variables A and B if necessary so that the smaller value ends up in : > A and the larger value ends up in B." : The only problem with your solution is that the question asks for : a bare statement; your solution would be embedded inside a block, : so it would fail to compile without some extra work... If the "question" is the one above, I don't see the word "bare" (or "fragment", etc.) anywhere. You asked for an if statement, I gave you an if statement. The fact that I put it in a complete (and more expressive) solution should be worth extra credit, not a failing grade! P.S. I always like the Bohr story, no matter how many times I hear it: http://www.snopes.com/college/exam/barometr.htm P.P.S. Notice that I didn't even comment before on the difficulties in putting the smaller value in A (via if statement or otherwise) if A = B....