% Example 1:  Areas of regular polygons inscribed and 
% circumscribed in the unit circle

disp('Compute areas of inscribed and circumscribed n-gons');
L= input('Enter lower bound for n: ');
R= input('Enter upper bound for n: ');

fprintf('\n n\tInner Area\tOuterArea\n');

n= L;  % n is no. of sides of n-gon
for n= L:1:R
   %Compute and display areas of n-gons
   innerA= (n/2)*sin(2*pi/n);
   outerA= n*tan(pi/n);
   fprintf('%d\t%.6f\t%.6f\n', n, innerA, outerA);
end
