summaryrefslogtreecommitdiff
path: root/662/CH10/EX10.4/Example10_4.sci
diff options
context:
space:
mode:
Diffstat (limited to '662/CH10/EX10.4/Example10_4.sci')
-rwxr-xr-x662/CH10/EX10.4/Example10_4.sci15
1 files changed, 15 insertions, 0 deletions
diff --git a/662/CH10/EX10.4/Example10_4.sci b/662/CH10/EX10.4/Example10_4.sci
new file mode 100755
index 000000000..c95fb96b9
--- /dev/null
+++ b/662/CH10/EX10.4/Example10_4.sci
@@ -0,0 +1,15 @@
+ //Example 10.4
+//Read a line of text from keyboard and display the same on screen
+global MAX_SIZE;
+MAX_SIZE = 50;
+
+function[] = main()
+ printf("Enter a line of text of maximum %d characters: ", MAX_SIZE);
+ str = read(%io(1), 1, 1, '(a)');
+ printf("The entered line is:\n");
+ write(%io(2),str);
+endfunction
+
+//Calling main()
+funcprot(0);
+main(); \ No newline at end of file