Professional Documents
Culture Documents
Act2 Modno Icsc102 Initials
Act2 Modno Icsc102 Initials
Name of Student: ALOROY, STONE JAMES B. Activity Title: ACTIVITY 2.1 –Algorithms,
Pseudocode, and Flowchart
Year and Section: 1 BSIT- FATIMA Date Submitted:
INSTRUCTIONS
Answers:
1.
A. Algorithm
Step 2: Calculate the absolute values of num1 and num2 to ensure positive integers.
Step 3: Calculate the GCD using the Euclidean algorithm. - Initialize variables a and b with the
absolute values of num1 and num2. - While b is not equal to 0, do the following: - Calculate
remainder = a % b. - Set a = b. - Set b = remainder. - GCD is now stored in variable a.
Step 4: Calculate the LCM using the formula LCM = (num1 * num2) / GCD.
2.
A. Algorithm
B. Pseudocode
C. Flowchart
3.A. Algorithm
B. Pseudocode
C. Flowchart