summaryrefslogtreecommitdiff
path: root/1553/CH2/EX2.18/2Ex18.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH2/EX2.18/2Ex18.sce')
-rw-r--r--1553/CH2/EX2.18/2Ex18.sce11
1 files changed, 11 insertions, 0 deletions
diff --git a/1553/CH2/EX2.18/2Ex18.sce b/1553/CH2/EX2.18/2Ex18.sce
new file mode 100644
index 000000000..7d19d2f52
--- /dev/null
+++ b/1553/CH2/EX2.18/2Ex18.sce
@@ -0,0 +1,11 @@
+//chapter 2 Ex 18
+clc;
+clear;
+close;
+n1=16; n2=24; n3=36; n4=54;
+n=lcm(int32([n1,n2,n3,n4]));
+Lcm=double(n);
+small=10000; //smallest 5 digit number
+remainder=pmodulo(small,Lcm);
+smallest_num=small+n-remainder;
+mprintf("The smallest such number is %d",smallest_num);