Wednesday, 15 September 2010

if statement - Pascal if then else doesn't work -



if statement - Pascal if then else doesn't work -

i've got problem pascal. i'm learning @ school , because utilize java, i'm little bit confused. not why doesn't work. trying create simple if (condition) write(this) else write(that) program, runs in cmd. when seek compile next code, says, have write ; instead of else, seems odd.

program project1; var max : integer; var max2 : integer; begin writeln('max: oh no, i'm integer'); writeln('which integer max supposed be?'); readln (max); writeln('max: don't want a', max); writeln('multiply max'); readln (max2); if (max = max * max2) writeln('no, not want a', max); else writeln('i think live beingness ', max * max2); readln; end.

program project1; var max : integer; var max2 : integer; begin writeln('max: oh no, im integer'); writeln('which integer max supposed be?'); readln (max); writeln('max: dont want a', max); writeln('multiply max'); readln (max2); if (max = max * max2) writeln('no, not want a', max) else writeln('i think live beingness ', max * max2); readln; end.

problem if statement, because if 1 line don't need close line ";" , problems string lines, don't utilize " ' " in middle of string

if-statement pascal freepascal

No comments:

Post a Comment