summaryrefslogtreecommitdiff
path: root/662/CH10/EX10.4/Example10_4.sci
blob: c95fb96b96b27e20f605481b74e9ac2a21ba13c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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();