local variables not used (pascal) -
it keeps saying i,cont , divisor not being used , cant figure out why, everthing assinged , used @ point.
i can compile using command prompt doesnt display should result shows simbols, , if try compiler shows local variable not used message not error says: note local variable "i" not used
here´s code
program tarea1; var n,m,i,divisor,cont: integer; begin readln(n); readln(m); if (n<1) or (m<n) end. i:=n; m begin divisor:=2; while (sqrt(i) >= divisor) , (i mod divisor <> 0) divisor:=divisor + 1; if (divisor > sqrt(i)) writeln(i': es primo') else begin (i div 2) begin divisor:= 2; cont:= 0; write(i':'); repeat if mod divisor = 0 begin write(' divisor '); divisor:=succ(divisor); cont:=succ(cont); until cont = 6; writeln(); end; end; end; end; end.
your program not long seem think.
around line 14 code is:
if (n<1) or (m<n) end.
this "end." end of source code - after not part of program!
if want terminate program if n less 1 or m less m should write
if (n<1) or (m<n) exit;
Comments
Post a Comment