0

hi
is there anyone who can help me to create a game program in pascal
hoping that one of you can help me please
even a simple calculator coz i really dont know how to create

5
Contributors
4
Replies
22
Views
7 Years
Discussion Span
Last Post by DonnSchwartz
0

It is a really simple calculator :)

program simple_calculator;
uses crt;
var a,b,result:real;
    m:set of char;
    choice:char;
begin
     clrscr;
     m:=[];
     include(m,'+');
     include(m,'-');
     include(m,'*');
     include(m,'/');
     repeat
           write('num1: ');
           readln(a);
           write('num2: ');
           readln(b);
           write('operator: + - * /  : ');
           readln(choice);
           case choice of
                '+':result:=a+b;
                '-':result:=a-b;
                '*':result:=a*b;
                '/':result:=a/b;
           end;
     until choice in m;
     writeln;
     writeln(a:0:0,choice,b:0:0,'=',result:0:2);

     while not keypressed do continue;
end.

(*created by FlamingClaw 2010.02.02.*)
0

you have got one good code above and if you want you will get more from google, i just tried now. Please check in google

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.