Write a program that prints itself.
Hi,
Here is a solution compiled with Turbo Pascal 7.1
uses crt; var i: integer;
const str: array[0..8] of string=(
'uses crt; var i: integer;',
'const str: array[0..8] of string=(',
'begin clrscr;',
'for i:=0 to 2 do writeln(str[i]);',
'for i:=0 to 8 do',
'if i<>8 then writeln(chr($27)+str[i]+chr($27)+chr($2C))',
'else writeln(chr($27)+str[i]+chr($27)+chr($29)+chr($3B));',
'for i:=3 to 8 do writeln(str[i]);',
'readkey; end.');
begin clrscr;
for i:=0 to 2 do writeln(str[i]);
for i:=0 to 8 do
if i<>8 then writeln(chr($27)+str[i]+chr($27)+chr($2C))
else writeln(chr($27)+str[i]+chr($27)+chr($29)+chr($3B));
for i:=3 to 8 do writeln(str[i]);
readkey; end.