0
Program calculator;
Var
N : integer ;
Op : char;
Begin
Repeat
  Writeln('Enter a number : ');
  Readln(N);
  Writeln('Enter an operator : ');
  Readln(Op);
Until ( Op = '=');

Then what should i do next to make the calculation and show it on the screen

Tom Brunberg
  • 20,312
  • 8
  • 37
  • 54
  • 1
    Welcome to StackOverflow. Unfortunately, it isn't a tutorial site, so your q is not a good fit here. Are you looking for something which will input two numbers and an operator and evaluate the result, or something which will evaluate an arbitrarily complex expression? There is a **big** difference ... If the former, read up on the `Case` statement, which you can use to determine what evaluation is performed, depending on the operator. – MartynA Oct 06 '18 at 16:57
  • Btw, see https://stackoverflow.com/questions/1326258/mathematical-expression-parser-in-delphi – MartynA Oct 06 '18 at 17:03
  • Possible duplicate of [mathematical expression parser in Delphi?](https://stackoverflow.com/questions/1326258/mathematical-expression-parser-in-delphi) – Rudy Velthuis Oct 06 '18 at 21:09
  • This will require library for expression evaluation. It would be helpful if you specified which compiler and version you use. – Marco van de Voort Oct 07 '18 at 10:53

0 Answers0