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 :)
Used to do Pascal programming in highschool :)
ReplyDeletecool blog concept, i'll be following
hows this work? where do i type it into?
ReplyDeleteWould you be able to explain what the various commands do, for the non-coders among us?
ReplyDeleteThanks for the code!
ReplyDeleteyoure doin it wrong, if you know what im sayin ^
ReplyDelete