Sunday, January 2, 2011

[TUTORIAL] Pascal

Today I will show you how to write a program in... PASCAL :D what is Pascal ? Pascal is very old programming language .
before we start, we must download one program FPC --> http://www.freepascal.org/download.var
Let's start :D

program p1;

begin
writeln('hello world');
readln();

end.

this is very easy program it's only show you text "HELLO WORLD " :D , Let's make calculator :D

program calculator;
var;
a,b:integer;
begin
writeln('type first number');
readln(a);
writeln('type second number');
readln(b);
writeln(a+b);
writeln(a*b);
writeln(a-b);
writeln(a/b);
readln();
end.

this is very easy, and "STUPID" calculator :D
In next lesson (tutorial :P) I will show you how to create program with 'IF' and menu :)

No comments:

Post a Comment