summaryrefslogtreecommitdiff
path: root/659/CH3/EX3.6/exm3_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '659/CH3/EX3.6/exm3_6.sce')
-rwxr-xr-x659/CH3/EX3.6/exm3_6.sce8
1 files changed, 8 insertions, 0 deletions
diff --git a/659/CH3/EX3.6/exm3_6.sce b/659/CH3/EX3.6/exm3_6.sce
new file mode 100755
index 000000000..8fb15d18d
--- /dev/null
+++ b/659/CH3/EX3.6/exm3_6.sce
@@ -0,0 +1,8 @@
+// Example 3.6
+//Program using a cast to evaluate the equation.
+
+sum1=0;
+for n=int8(1:10)
+ sum1=sum1+1/double(n); //conversion from 'int' to 'double' or 'float'
+ printf("%2d %6.4f\n",n,sum1);
+end \ No newline at end of file