Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, January 9, 2011

[TUTORIAL] Pascal V4

Hi, today I will show you variables in pascal :)

--TYPE-- --RANGE--  --
  • integer -32768...32767 
  • byte 0...255  
  • longint -2147483648...2147483647 
  • shortint -128...127  
  • word 0...65535 
  • real 5.0x10-324...1.7x10308  
  • double 5.0x10-324...1.7x10308 
  • extended 3.4x10-4932..1.1x104932  
  • comp -9 223 372 036 854 775 808...9 223 372 036 854 775 807 
  • string 
I hope it's will be help you :)

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