summaryrefslogtreecommitdiff
path: root/1553/CH1/EX1.31/1Ex31.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH1/EX1.31/1Ex31.sce')
-rw-r--r--1553/CH1/EX1.31/1Ex31.sce11
1 files changed, 11 insertions, 0 deletions
diff --git a/1553/CH1/EX1.31/1Ex31.sce b/1553/CH1/EX1.31/1Ex31.sce
new file mode 100644
index 000000000..1e9b31f55
--- /dev/null
+++ b/1553/CH1/EX1.31/1Ex31.sce
@@ -0,0 +1,11 @@
+//chapter 1 Ex 31
+
+clc;
+clear;
+close;
+//This problem can be solved using Arithmetic Progression formula
+a=2; d=2; //since even numbers, the difference is 2
+l=74; //given less than 75
+n=l/2;//number of elements in series, divided by 2 since even numbers
+Sum=n/2*(a+l);
+printf("The sum of even numbers less than 75 is %d",Sum);