Sure, here's an example of how you can create a loop in your calculator code so that it continues to run until the user presses a specific key (such as "N"):
Copy code
var continue: char; begin continue := 'Y'; while (continue = 'Y') do begin // your calculator code here writeln('Do you want to continue? (Y/N)'); readln(continue); end; end.
This will create a "while" loop that will continue to execute as long as the "continue" variable is equal to 'Y'. Inside the loop, you can place your existing calculator code, and then ask the user if they want to continue by typing "Y" or "N" using the "readln" command. If the user enters "N", the "continue" variable will be updated and the loop will be terminated, ending the program.