diff options
Diffstat (limited to '1553/CH6/EX6.2/6Ex2.sce')
-rw-r--r-- | 1553/CH6/EX6.2/6Ex2.sce | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/1553/CH6/EX6.2/6Ex2.sce b/1553/CH6/EX6.2/6Ex2.sce new file mode 100644 index 000000000..b07cb08c2 --- /dev/null +++ b/1553/CH6/EX6.2/6Ex2.sce @@ -0,0 +1,9 @@ +//chapter 6 Ex 2
+
+clc;
+clear;
+close;
+n=40;
+Sum=n*(n+1)/2; //formula for sum of first n natural numbers
+avg=Sum/n;
+mprintf("The required average is %.1f",avg);
|