S
S
s1leence2021-04-14 14:49:12
Pascal
s1leence, 2021-04-14 14:49:12

Gives an error Program1.pas(9): 'else' encountered and statement expected?

Program a;
var x,y:real;
begin
 writeln('Введиите переменную x');
 read(x);
 if x < 0 then;
  y:=cos(2*x)+exp(x);
  writeln('y=',y);
 else
  y:=7x/abs(2x-1);
  writeln(‘y=‘,y);
end.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2021-04-14
@longclaps

Program a;
var x, y: real;
begin
  writeln('Введиите переменную x');
  read(x);
  if x < 0 then y := cos(2*x)+exp(x)
  else y := 7*x/abs(2*x-1);
  writeln('y=',y);
end.

Too many mistakes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question