From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 662/CH10/EX10.4/Example10_4.sci | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 662/CH10/EX10.4/Example10_4.sci (limited to '662/CH10/EX10.4/Example10_4.sci') 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 -- cgit