# help: source code for calculator

i have made a new version of the fraction calculator. can anyone see why this source code doesn't work?

thanks

[code]
program fractions2(input,output);
var m,n,i,j : integer;
k,l : char;
procedure gcd(y,g : integer; var gcd : integer);
begin
while (y>0) and (g>0) do
if y>=g then y := y mod g else g :=j mod g;
gcd:=y+g
end;
function fraction(o,p : integer;) : integer;
begin
if (o>p) then
writeln(o div p, ’ ’, (o mod p)/gcd(o,p));
writeln(’=’, ’ ’, ’−−−−’);
writeln(’ ’, p/gcd(o,p))
end;
begin
z:=v*f;
c:=(u*f)+(v*d);
writeln(’ ’, u, ’ ’, d,’ ’, c);
Writeln(’Sum is: ’, ’ −−− ’, ’+’, ’ −−− ’, ’=’, ’−−−−−−−−−−−’, fraction
(c,z));
writeln(’ ’, v, ’ ’, f, ’ ’, z)
end;
procedure multiply(u,v,d,f,z,c : integer);
begin
z:=v*f;
c:=u*d;
writeln(u, ’*’, d, ’ ’, c);
writeln(’−−−−−’, ’ = ’, ’−−−−’, ’=’, fraction(c,z));
writeln(v, ’*’, f, ’ ’, z)
end;
procedure subtract(u,v,d,f,z,c : integer);
begin
z:=v*f;
c:=(u*f)−(v*d);
writeln(’ ’, u, ’ ’, v,’ ’, c);
Writeln(’Sum is: ’, ’ −−− ’, ’−’, ’ −−− ’, ’=’, ’ −−−−−−−−−−−’, fractio
n(c,z));
writeln(’ ’, v, ’ ’, f, ’ ’, ’ ’, z)
end;
procedure divide(u,v,d,f,z,c : integer);
begin
if d=0 then writeln(’data not acceptable’)
else
z:=v*d;
c:=u*f;
writeln(u, ’*’, f, ’ ’, c);
writeln(’−−−−−−’, ’ = ’, ’ −−−−’, ’=’, fraction(c,z));
writeln(v, ’*’, d, ’ ’, z);
end;

begin

writeln(’Do you want to perform operations with fractions (y/n)’);
while (l=y) do
begin
writeln(’Give data’);
writeln(’Give first fraction’);
writeln(’Give numerator:’);
writeln(’Give denominator’);
writeln(’Give second fraction’);
writeln(’Give numerator’);
writeln(’Give denominator’);
if (n=0) or (j=0) or (i<0) or (j<0) or (m<0) or (n<0) then
begin
writeln(’data not acceptable−cannot proceed’)
end.
else
case k of
’*’ : multiply(m,n,i,j);
’/’ : divide(m,n,i,j);