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 --- 659/CH5/EX5.1/exm5_1.sce | 15 +++++++++++++++ 659/CH5/EX5.1/exm5_1_output.PNG | Bin 0 -> 3057 bytes 2 files changed, 15 insertions(+) create mode 100755 659/CH5/EX5.1/exm5_1.sce create mode 100755 659/CH5/EX5.1/exm5_1_output.PNG (limited to '659/CH5/EX5.1') 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 new file mode 100755 index 000000000..f5919175b Binary files /dev/null and b/659/CH5/EX5.1/exm5_1_output.PNG differ -- cgit