summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/c-pascal/demo2.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/generic/c-pascal/demo2.tex')
-rw-r--r--Master/texmf-dist/doc/generic/c-pascal/demo2.tex49
1 files changed, 49 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/c-pascal/demo2.tex b/Master/texmf-dist/doc/generic/c-pascal/demo2.tex
new file mode 100644
index 00000000000..bd26d89b713
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/c-pascal/demo2.tex
@@ -0,0 +1,49 @@
+\input cap
+
+
+A short program in C. It was inserted directly into the \TeX\ source file.
+
+\medskip
+\BeginC
+#include <stdio.h>
+
+void main()
+{
+ a=~a;
+ printf("Hello, world!\n");
+ // printf("Hello, world!\n");
+}
+\EndC
+
+\hrule
+\bigskip
+
+And now a program inserted from a separate file.
+
+\medskip
+\InputC{prog/sun.c}
+
+\vfill\eject
+
+
+And now programs written in Pascal. This one was typed directly into this
+file.
+
+\medskip
+\BeginPascal
+program Hello_world;
+begin
+ writeln('Hello, world!');
+ { writeln('Hello, world!'); }
+end.
+\EndPascal
+
+\hrule
+\bigskip
+
+This one was imported from another file.
+
+\medskip
+\InputPascal{prog/guess.pas}
+
+\bye