It looks like you're new here. If you want to get involved, click one of these buttons!
Hello friends, I am new in turbo pascal and I want to write a code that multiplies two large numbers each has 20 digits. I think I should use arrays, right?!
Thanks for you help.
you should use string instead. I will post the full answer tomorrow cause I'm too busy now
this function is quite hard to understand so you should read it carefully. in this function, "Add" is a function to plus two numbers in string. It's easy so you can write it yourself.
Function multiply(a,b : string): string;
Var sum,temp : string;
m,i,j : integer;
for i:=length(a) downto 1 do
for j:=1 to ord(a[i])-48 do tmp:=add(tmp,b);
for j:=1 to m do tmp:=tmp+'0';