Alvinray's blog

"Iron will rust if not used, the stagnant water loses its purity and in cold weather will freeze. our brains will be like that if we do not use it to learn about something"
English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified


WELCOME TO ALVIN RAY'S BLOG, PLEASE LEAVE COMMENT BEFORE LEAVING, AND THANKS FOR COMING

How to make a simple program in pascal ?

Posted by Alvin Raylandi On 2/15/2012 10:22:00 PM 0 komentar

hi guys, i would like to tell you about how to make a program in pascal application..
i will give you some example, like to make a carculator in pascal..
this is the code :

program carculator;
uses crt;
var
a,b,c:integer;
begin
clrscr;
writeln('This is a simple addition calculating program');
write('Put in the first number  ');readln(a);
write('Put in the second number  ');readln(b);
c:=a+b;
writeln('the result of the sum above is  ',c); 
readln;
 
end.


that's the simple carculating program, if you want to change it to others, i will give you the formula:
c:=a div b <-- divide
c:=a-b <-- reduction
c:=a*b <-- times
c:=a+b <-- sum
to save the program after you input the script press F2
to run it press CTRL + F9



btw.. sorry for my bad english :P
have fun tried it :)

0 komentar:

Posting Komentar

PLEASE DON'T FORGET TO LEAVE A COMMENT HERE