F
F
flatcar2015-09-09 20:01:55
Pascal
flatcar, 2015-09-09 20:01:55

Timer in Pascal, cycle, tell me?

Let's say I made such a simple program:
var
a: longint;
begin
writeln('Enter an integer (max. 2100000000)');
readln(a);
if a mod 2 = 0 then writeln('This number is even')
else writeln('This number is odd');
end.

When launched in the .exe extension, the program closes immediately after execution. Tell me the source code of the timer and how to set an infinite loop (so that the program is constantly repeated).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kolegov, 2015-09-09
@flatcar

Wrap everything in a wile loop, and tell the user to e.g. press 0 to exit if non-zero is entered, the loop continues.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question