A little more like this perhaps:
v0 = [15:60]; %initial speed
a = [15:60]; %angle
g = 9.81; %gravitational acceleration
l = 100; %distance from ball to hole
fprintf('the ball falls on the field in the following cases:\n');
for i = 1:length(v0)
for j = 1:length(a)
D = (v0(i)^2*sind(2*a(j)))/g;
if D>=97.5 && D<=102.5
fprintf('Vo = %.2f m/s | angle = %.2f° | D = %.2f \n',v0(i),a(j), D);
end %Need new if because 100 falls between 97.5 and 102.5
if abs(D-l)<0.5 % Never test for exact equality with floating point numbers
fprintf('HOLE IN ONE! Vo = %.2f m/s | angle = %.2f° | D = %.2f \n',v0(i),a(j), D);
end
end
end
To reduce the coarseness of the test abs(D-l)<0.5 to, say, abs(D-l)< 0.1, you will need to decrease the values of the step sizes for v0 and a.