Hello :) this is next Pascal tutorial, today I will show you how to create a nice menu on if :) it's not very hard to do it :) ok let's go :)
program menuif;
var
a,b:integer;
c:byte;
begin
writeln('type first number');
readln(a);
writeln('type second number');
readln(b);
writeln('MENU');
writeln('what do you want to do ? ');
writeln('1.addition (+)');
writeln('2.subtraction (-)');
readln(c);
if c=1 do
begin
writeln(a+b);
readln();
end;
if c=2 do
begin
writeln(a-b);
readln();
end;
readln();
end.
In next tutorial I will show how to do a menu on 'CASE', I think menu on 'IF' it's not a good way :)