Tuesday, January 4, 2011

[TUTORIAL] Pascal V3

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 :)

5 comments:

  1. Used to do Pascal programming in highschool :)

    cool blog concept, i'll be following

    ReplyDelete
  2. hows this work? where do i type it into?

    ReplyDelete
  3. Would you be able to explain what the various commands do, for the non-coders among us?

    ReplyDelete
  4. youre doin it wrong, if you know what im sayin ^

    ReplyDelete