summaryrefslogtreecommitdiff
path: root/659/CH6/EX6.3
diff options
context:
space:
mode:
Diffstat (limited to '659/CH6/EX6.3')
-rwxr-xr-x659/CH6/EX6.3/exm6_3.sce12
-rwxr-xr-x659/CH6/EX6.3/exm6_3_output.PNGbin0 -> 25181 bytes
2 files changed, 12 insertions, 0 deletions
diff --git a/659/CH6/EX6.3/exm6_3.sce b/659/CH6/EX6.3/exm6_3.sce
new file mode 100755
index 000000000..f2a22b0ae
--- /dev/null
+++ b/659/CH6/EX6.3/exm6_3.sce
@@ -0,0 +1,12 @@
+// Example 6.3
+//The program uses a for loop to print the "Power of 2" table for the
+//power 0 to 20, both positive and negative.
+
+disp("-----------------------------------------");
+printf(" 2 to power n n 2 to power -n\n");
+disp("-----------------------------------------");
+for n=0:20 //Loop begins
+ p=2^n;
+ q=2^-n;
+ printf("%7d %9d %10.12f\n",p,n,q);
+end //Loop ends
diff --git a/659/CH6/EX6.3/exm6_3_output.PNG b/659/CH6/EX6.3/exm6_3_output.PNG
new file mode 100755
index 000000000..684eabf63
--- /dev/null
+++ b/659/CH6/EX6.3/exm6_3_output.PNG
Binary files differ