diff options
Diffstat (limited to '659/CH4/EX4.1/exm4_1.sce')
-rwxr-xr-x | 659/CH4/EX4.1/exm4_1.sce | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/659/CH4/EX4.1/exm4_1.sce b/659/CH4/EX4.1/exm4_1.sce new file mode 100755 index 000000000..b6d2d6945 --- /dev/null +++ b/659/CH4/EX4.1/exm4_1.sce @@ -0,0 +1,13 @@ +// Exaymple 4.1
+// The program shows the use of getchar function in an intractive environment.
+//In Scilab in place of getchar function scanf function can be used to get
+//character as there is no getchar function in Scilab.
+
+disp("Would you like to know my name?");
+disp("Type Y for YES and N for NO:");
+answer=scanf("%c"); //Reading character
+if (answer=='Y')|(answer=='y') then //Test for answer
+ disp("My name is BUSY BEE");
+else
+ disp("You are good for nothing")
+end
\ No newline at end of file |