S
S
s1leence2021-04-14 16:40:15
Pascal
s1leence, 2021-04-14 16:40:15

Program1.pas(16): 'else' encountered and statement expected?

begin
   readln(a, b, c) ;
   D:=sqr(b) - 4*a*c;
   writeln('D= ', D);
   if D=0 then
       begin
          x:= -b/2*a;
          writeln('x= ', x:8:3);
       end;
   if D>0 then
       begin
          x1:= -b+sqrt(D)/2*a;
          x2:= -b-sqrt(D)/2*a;
          writeln('x1= ', x1:8:3, 'x2= ', x2:8:3) ;
       end;
    else writeln('Корней нету!');
end.

6076f0b8d7fee642497347.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kalapanga, 2021-04-14
@kalapanga

No semicolon before else

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question