regards the pascal mania, on a clear night, I am going to share a tutorial to make the program count or what we often refer to as the machine count CALCULATOR. in essence, we will create a program that is possessed four elements of the calculation, the first multiplication, division, addition, and the last reduction. just follow the steps below carefully.
How to make the program count CALCULATOR :
- Turbo pascal you open the program.
- Select the file - new.
- And write the code as below.
- Then compile - compile or alt + f9 to make sure there are no errors in your program code.
- If there are no errors please select run - run.
- Congratulations you can make the program count yourself.
summation program;
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a+b;
writeln(results from the sum: ',result;
readln;
end.
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a+b;
writeln(results from the sum: ',result;
readln;
end.
reduction program;
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a-b;
writeln(result of the reduction : ',result);
readln;
end.
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a-b;
writeln(result of the reduction : ',result);
readln;
end.
multiplication program;
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a*b;
writeln(the result of multiplication : ',result);
readln;
end.
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a*b;
writeln(the result of multiplication : ',result);
readln;
end.
division program;
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a/b;
writeln(the result of the division : ',result);
readln;
end.
uses crt;
var a,b,result : real;
begin
clrscr;
write('enter the value 1 :');readln(a);
write('enter the value 2 :');readln(b);
writeln;
result:=a/b;
writeln(the result of the division : ',result);
readln;
end.
* Greeting pascal mania and may be useful.
Apakah ini cara membuat kalkulator? kalau bisa ada terjemahannya mas, saya agak bingung.
ReplyDeletepilih aja translate, pojok kanan atas
ReplyDelete
ReplyDeleteThanks for sharing your concept about it. Actually i had no concept about but now i am clear.
novated lease calculator
how can we put the program calculator in one, like all the programs can be put in one?
DeleteYou can can combine them into one by using the code sub menu in turbo pascal
Delete