diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /659/CH12/EX12.1 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '659/CH12/EX12.1')
-rwxr-xr-x | 659/CH12/EX12.1/exm12_1.sce | 24 | ||||
-rwxr-xr-x | 659/CH12/EX12.1/exm12_1_output.PNG | bin | 0 -> 9136 bytes |
2 files changed, 24 insertions, 0 deletions
diff --git a/659/CH12/EX12.1/exm12_1.sce b/659/CH12/EX12.1/exm12_1.sce new file mode 100755 index 000000000..c5ab08b6a --- /dev/null +++ b/659/CH12/EX12.1/exm12_1.sce @@ -0,0 +1,24 @@ +// Example 12.1
+// Write a program to read data from keyboard,write it to a file called INPUT,
+// again read the same data from the INPUT file and display it on the screen.
+
+warning('off');
+disp("Data Input");
+
+//Open the file INPUT
+f1=mopen('INPUT.txt','w');
+// Get character from keyboard
+c=read(%io(1),1,1,'(a)');
+mfprintf(f1,'%s',c);
+
+//close the file input
+mclose(f1);
+
+
+disp("Data Output");
+//Reopen the file INPUT
+f1=mopen('INPUT.txt','r');
+ txt=mgetl(f1);
+ printf("%s",text);
+//close the file input
+mclose(f1);
diff --git a/659/CH12/EX12.1/exm12_1_output.PNG b/659/CH12/EX12.1/exm12_1_output.PNG Binary files differnew file mode 100755 index 000000000..568022792 --- /dev/null +++ b/659/CH12/EX12.1/exm12_1_output.PNG |