Task

Write a program that prints the integers from   1   to   100   (inclusive).



But:

   for multiples of three,   print   Fizz     (instead of the number)
   for multiples of five,   print   Buzz     (instead of the number)
   for multiples of both three and five,   print   FizzBuzz     (instead of the number) 


The   FizzBuzz   problem was presented as the lowest level of comprehension required to illustrate adequacy.



Also see

   (a blog)   dont-overthink-fizzbuzz
   (a blog)   fizzbuzz-the-programmers-stairway-to-heaven


BEGIN
 
INTEGER FUNCTION DIVBY(N, D);
INTEGER N;
INTEGER D;
BEGIN
  DIVBY := 1 - (N - D * (N / D));
END;
 
INTEGER I;
FOR I := 1 STEP 1 UNTIL 100 DO
BEGIN
  IF DIVBY(I, 15) = 1 THEN
    WRITE("FizzBuzz")
  ELSE IF DIVBY(I, 5) = 1 THEN
    WRITE("Buzz")
  ELSE IF DIVBY(I, 3) = 1 THEN
    WRITE("Fizz")
  ELSE
    WRITE(I);
END;
 
END