function limite

n = askforn;
fprintf('An approximation of e with n = %d is %.2f\n', ...
        n, (1 + 1/n) ^ n)

function outn = askforn
inputnum = input('Enter a positive integer for n: ');
num2 = int32(inputnum);
while num2 ~= inputnum || num2 < 0
   inputnum = input('Invalid! Try again: ');
   num2 = int32(inputnum);
end
outn = inputnum;

