Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,30 @@
PROGRAM LCM
PROCEDURE GCD(A,B->GCD)
LOCAL C
WHILE B DO
C=A
A=B
B=C MOD B
END WHILE
GCD=ABS(A)
END PROCEDURE
PROCEDURE LCM(M,N->LCM)
IF M=0 OR N=0 THEN
LCM=0
EXIT PROCEDURE
ELSE
GCD(M,N->GCD)
LCM=ABS(M*N)/GCD
END IF
END PROCEDURE
BEGIN
LCM(18,12->LCM)
PRINT("LCM of 18 AND 12 =";LCM)
LCM(14,-6->LCM)
PRINT("LCM of 14 AND -6 =";LCM)
LCM(0,35->LCM)
PRINT("LCM of 0 AND 35 =";LCM)
END PROGRAM