0

help me please
validator make this error
Compiling the source code....
$fpc -v0 viens.pas 2>&1

Free Pascal Compiler version 2.6.2 [2013/02/16] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
viens.pas(3,1) Fatal: Syntax error, ";" expected but "BEGIN" found
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode (normal if you did not specify a source file to be compiled)

program one;
var x,y:integer
begin
randomize;
for x:=1 to 6 do
x:=random(6)+1
for y:= 10 to 20
y:=random(20)+10
writeln('enter the number');
writeln (Sqr(x):0);
Writeln (Sqrt(x):0);
writeln('result',x,y,');
readln(x,y);
end;
end.

2
Contributors
1
Reply
24
Views
3 Years
Discussion Span
Last Post by SalmiSoft
2

The error message is quite specific:
";" expected but "BEGIN" found

So it was expecting to find a semi-colon and instead it found the word "begin".

Looking through your code there is only 1 begin:

program one;
var x,y:integer
begin

So that is where the error is. It wants to see a semi-colon at the end of the line:
var x,y:integer
and instead it found begin.

Your error is that you forgot the semi-colon. So the line should read:

var x,y:integer;

Votes + Comments
Well explained!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.