% fizzbuzz.m

% one way of doing it
for i = 1:100
    if ( (mod(i,3)==0) && (mod(i,5)==0) )
        fprintf('FizzBuzz\n');
    elseif (mod(i,3)==0)
        fprintf('Fizz\n');
    elseif (mod(i,5)==0)
        fprintf('Buzz\n');
    else
        fprintf('%d\n', i);
    end
end

% another way of doing it
for i = 1:100
   if(mod(i,3)==0)
       fprintf('Fizz');
   end
   if(mod(i,5)==0)
       fprintf('Buzz');
   end
   if ((mod(i,3)~=0) && (mod(i,5)~=0))
       fprintf('%d',i);
   end
   fprintf('\n');    
end
