Re: Powers of 5



"Josh" <jzenker@xxxxxxxxx> wrote in news:1157411739.760781.256730@
74g2000cwt.googlegroups.com:

Hi, I'm an undergrad studying computer science. I discovered, while
studying for a computer science final, that I still haven't come up
with an answer to a question that was offered as extra credit on our
first quiz in the course. We were given the following Pascal code.

function power(n: integer): integer;
begin
if n <= 1 then
return (5)
else
return (5 * power(n-1))
end; {power}

Non-sequiteur: For n<1, this algorithm is flat wrong.
.



Relevant Pages

  • Re: Powers of 5
    ... studying for a computer science final, that I still haven't come up ... with an answer to a question that was offered as extra credit on our ... first quiz in the course. ...
    (sci.math)
  • Re: Thank God for students...
    ... Some of them students know quite alot about computers if they're studying ... computer science. ...
    (uk.telecom.broadband)

Loading