Re: Powers of 5
- From: John Schutkeker <jschutkeker@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Sep 2006 23:18:12 GMT
"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.
.
- References:
- Powers of 5
- From: Josh
- Powers of 5
- Prev by Date: Re: Regarding the properties of a positive definite matrix
- Next by Date: Re: Polynomial primes!
- Previous by thread: Re: Powers of 5
- Next by thread: Re: Triangles Inscribed in a Circle
- Index(es):
Relevant Pages
|
Loading