You might have to bear in mind, i'm only been using Freebasic for a short while and the fact i've not been programming too long. :)
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
I had -lang qb on the command line
Try this:
declare function gcd(x as single,y as single) as single
print gcd(112,144)
sleep
function gcd(x as single,y as single) as single
dim q as single, r as single
do
q=int(x/y)
r=x-q*y
x=y
y=r
loop until r<=0
gcd=x
end function
<rant> While I'm at it, the above requirement to declare all variables goes against
the
entire intention of BASIC. Find a copy of Back to BASIC by John Kemeny and
Tom Kurtz (the authors of BASIC) and you'll get a good feeling for what BASIC
is really supposed to be. </rant>
Tom Lake