diff options
Diffstat (limited to '1553/CH1/EX1.24/1Ex24.sce')
-rw-r--r-- | 1553/CH1/EX1.24/1Ex24.sce | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/1553/CH1/EX1.24/1Ex24.sce b/1553/CH1/EX1.24/1Ex24.sce new file mode 100644 index 000000000..563fd301a --- /dev/null +++ b/1553/CH1/EX1.24/1Ex24.sce @@ -0,0 +1,14 @@ +//chapter 1 Ex 24
+
+clc;
+clear;
+close;
+n1=684; n2=759; n3=413; n4=676;
+ //in order to find unit digit in product of above 4 numbers, we find product of unit digits of each of these numbers
+//unit places of each of the 4 numbers
+unit1=modulo(modulo(n1,100),10); //since given number is 3 digit
+unit2=modulo(modulo(n2,100),10);
+unit3=modulo(modulo(n3,100),10);
+unit4=modulo(modulo(n4,100),10);
+unitProduct=unit1*unit2*unit3*unit4;
+printf("The unit digit of product is %d.",modulo(unitProduct,10));
|