gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
new InOut samples, one for a char, other for branching
authorDoni Pracner <quinnuendo@gmail.com>
Wed, 30 Jul 2014 20:18:07 +0000 (22:18 +0200)
committerDoni Pracner <quinnuendo@gmail.com>
Wed, 30 Jul 2014 20:18:07 +0000 (22:18 +0200)
samples/InOut2.mj [new file with mode: 0644]
samples/InOut3.mj [new file with mode: 0644]

diff --git a/samples/InOut2.mj b/samples/InOut2.mj
new file mode 100644 (file)
index 0000000..7c81f38
--- /dev/null
@@ -0,0 +1,10 @@
+program InOut2{
+       void main()
+       char c;
+       {
+                       print('c');
+                       print('?');
+                       read(c);
+                       print(c);
+       }
+}
\ No newline at end of file
diff --git a/samples/InOut3.mj b/samples/InOut3.mj
new file mode 100644 (file)
index 0000000..73d7ddd
--- /dev/null
@@ -0,0 +1,23 @@
+program InOut3{
+       void main()
+       char c;
+       int i;
+       {
+                       i = 5;
+                       print('c');
+                       print('?');
+                       read(c);
+                       print(c);
+                       print(chr(10));
+                       if (c=='y') {
+                               print('i');
+                               read(i);
+                       } else {
+                               print('c');
+                               read(c);
+                       }
+                       print(chr(10));
+                       print(i,5);
+                       print(c,5);
+       }
+}
\ No newline at end of file
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner