jeudi 26 novembre 2020

How to fix an error in a for loop. Pascal

I wrote a programm, but there is an error that i can't understand.

Error: main.pas(23,11) Fatal: Syntax error, ")" expected but "ordinal const" found

program Hello; <-- 10 line
var 

x : integer;
y : integer;


begin


for x := 0 to 120 do

    begin
                                <-- error line
        if ( x % 5 = 0 ) then
            writeln (x);
    
    end;

  
end. <-- 30 line

Aucun commentaire:

Enregistrer un commentaire