Answer the question
In order to leave comments, you need to log in
Why does it give the error "Met 'else' but expected ';'"?
program BegemotKashelot;
var x, y: integer;
begin
writeln('Введите x =');
read(x);
if x < -1 then
begin
y:= 2-sqr(x);
writeln('y=',y)
end
else
begin
if (x>=-1) and (x<=2) then
y:= 2*x;
writeln('y=',y);
end
else
if x>2 then
begin
y:= 2-x;
writeln('y=',y);
end
end.
Program1.pas(17) : Встречено 'else', а ожидалось ';'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question