diff options
Diffstat (limited to '1553/CH1/EX1.32/1Ex32.sce')
-rw-r--r-- | 1553/CH1/EX1.32/1Ex32.sce | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/1553/CH1/EX1.32/1Ex32.sce b/1553/CH1/EX1.32/1Ex32.sce new file mode 100644 index 000000000..2d8b0d4bf --- /dev/null +++ b/1553/CH1/EX1.32/1Ex32.sce @@ -0,0 +1,13 @@ +//chapter 1 Ex 32
+
+clc;
+clear;
+close;
+//given series is in AP in which first element a1=6, second element a2=15, last element an=105
+a1=6; a2=15; d=a2-a1; an=105;
+
+//formula for last element is a1+(n-1)*d=an; where n is number of elements in series
+n=(an-a1)/d+1;
+
+Sum=n/2*(a1+an);
+printf("The required sum is %d",Sum);
|