Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
var a,b, average: real;
writeln('Your two marks are:');
average= (a +b)/2;
writeln('Your average is:');
if average >=50
write('You Passed! Good Job!')
write ('You failed, sorry');
The conditional instruction is for acting intelligently, taking one or more actions if a condition is met and other action(s) if another condition is met. For example:
IF b=0 THEN write ('You can not do divisions by 0!') ELSE BEGIN write (a div b); readln; END; end.
So, the syntax is:
if <condition> then <command> else <command>
If there are more commands to execute, they will be grouped in BEGIN ... END. If after IF's command (or the END if there are more commands) there is the ELSE statament, then there must be no semicolon after the previous word.