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/CH5/EX5.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/CH5/EX5.1')
-rwxr-xr-x | 659/CH5/EX5.1/exm5_1.sce | 15 | ||||
-rwxr-xr-x | 659/CH5/EX5.1/exm5_1_output.PNG | bin | 0 -> 3057 bytes |
2 files changed, 15 insertions, 0 deletions
diff --git a/659/CH5/EX5.1/exm5_1.sce b/659/CH5/EX5.1/exm5_1.sce new file mode 100755 index 000000000..8a433b01d --- /dev/null +++ b/659/CH5/EX5.1/exm5_1.sce @@ -0,0 +1,15 @@ +// Example 5.1
+// The program reads four values a,b,c and d from the terminal and
+//evaluates the ratio of (a+b) to (c+d) and prints the result,if c-d
+//is not equal to zero
+
+disp("Enter four integer values");
+a=int8(input("a="));
+b=int8(input("b="));
+c=int8(input("c="));
+d=int8(input("d="));
+
+if(c-d ~= 0) then //Execute statement block
+ ratio=double(a+b)/double(c-d);
+ printf("Ratio=%f\n",ratio);
+end
\ No newline at end of file diff --git a/659/CH5/EX5.1/exm5_1_output.PNG b/659/CH5/EX5.1/exm5_1_output.PNG Binary files differnew file mode 100755 index 000000000..f5919175b --- /dev/null +++ b/659/CH5/EX5.1/exm5_1_output.PNG |