Task: given two arrays of the same length. Write a recursive function that compares the elements of the array and if everything came together, then true, and if not, false. The program does not work correctly. In this case, I tried to replace the second element of the array b with "2", but the result is still true. Tell me what's wrong?
var a:array[0..4] of integer; b:array[0..4] of integer; i:integer; function check(a,b:array of integer;i:integer):boolean; begin if a[i]=b[i] then begin result:=true; check(a,b,i+1); end else begin result:=false; exit; end; end; begin for i:=0 to 4 do a[i]:=i; for i:=0 to 4 do b[i]:=i; b[1]:=2; writeln(check(a,b,0)); for i:=0 to 4 do writeln(a[i], ' = ' , b[i]); readln; end.