0

hi i want to run this code but it show me several errors please any one can help

Program Climat;
var clim: integer;
begin
Writeln('entrez degré');
Readln(clim);
if (clim < 0) then
Writeln('c est glacial ');
else 
if (clim < 30) then
Writeln('le temps est doux');
else
Writeln('trés chaud'):
end.

1 Answer 1

6

Pascal expects one statement between then and else, and a statement does not ends with a ;. ; is used as a separator of statements in compound statment.

To get rid of your errors do one of:

  1. Remove ; at the end of the Writeln('c est glacial ') and Writeln('le temps est doux')
  2. or use compound statements: write then begin and end else instead of just then and else.

Also after the last Writeln there should be ; instead of :.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.