Thursday, October 10, 2013

Algorithm to print all the integers between 1 and N which are evenly divisible by 6 and 7

STEP 1.      I <-- 1, N <-- 0
STEP 2.      Read N
STEP 3.      While (I <= N) do Steps 4 and 5
STEP 4.      Is (I mod 6 = 0 AND I mod 7 = 0) Then
Begin
Print I
End
STEP 5.      I <-- I + 1

1 comment: