Showing posts with label Tutorial PC. Show all posts
Showing posts with label Tutorial PC. Show all posts

Sunday, January 2, 2011

[TUTORIAL] Pascal V2

Hello, in this tutorial I will explain you what some 'command' mean in pascal :)

program - for explain 'program p1' it's mean your program will be name p1
writeln - for explain 'writeln('hello world');' computer will be show you text in this case it's will be hello world
readln - for explain 'readln(a);' now if you type 6,variable a will be 6 if you don't type anythink like 'readln();' computer will be wait for any action for example if you hit enter program will be continue

That's all for now, in next tutorial I will show you somethink about variable in Pascal :)

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