Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Niklaus Wirth designed Pascal in 1970 to teach structured programming, and it succeeded so thoroughly that a generation of programmers — and much of early Apple software — grew up on it. Turbo Pascal made it the definitive learning language of the 1980s-90s, and its lineage lives on commercially through Delphi and in open source through Free Pascal (the 3.2 series) with the Lazarus IDE; early Skype clients were famously built on Delphi. Pascal remains in classrooms today: several school systems and international olympiad traditions still teach it, prized for readable syntax and strict typing that catches beginner mistakes early. This page compiles Pascal and runs it in a live terminal where readln waits for your genuine keyboard input.
program InteractiveDemo;
var
name: string;
n, i: integer;
total: int64;
begin
write('What is your name? ');
readln(name);
writeln('Hello, ', name, '!');
write('Compute the factorial of: ');
readln(n);
total := 1;
for i := 2 to n do
total := total * i;
writeln(n, '! = ', total);
if total mod 2 = 0 then
writeln('The result is even.')
else
writeln('The result is odd.');
end.
Pascal remains a set language in secondary-school computing curricula in several countries and a nostalgic-but-real skill for maintaining Delphi codebases, which still run point-of-sale, medical, and industrial software. Students use this page for homework — loops, procedures, records, arrays — without installing Free Pascal, and competitive programmers from olympiad traditions that permitted Pascal can warm up here. It's also a gentle first language for learners who benefit from begin/end blocks and compiler-enforced type discipline before moving to C or Java.
Yes. readln suspends the running program until you enter a line in the terminal, and write output (like a prompt without a newline) is displayed first, so interactive programs behave exactly as in a local console. You can mix readln for strings and numbers across multiple prompts freely.
Programs are built with Free Pascal, the actively maintained open-source compiler, which supports classic Turbo Pascal syntax plus Object Pascal extensions and modern types like int64 and dynamic arrays. Textbook Pascal compiles unchanged, and most Delphi-style language features work in the appropriate mode.
No — this is a console environment, so Lazarus LCL forms and Delphi VCL units aren't available, and execution is a single source file. Standard units that ship with Free Pascal (SysUtils, Math, StrUtils) are usable, which covers essentially all coursework and console-program needs.
main.paspascalReadLn()program Hello;
begin
writeln('Hello from Pascal!');
writeln('Welcome to XCODX Online Compiler!');
end.