%stirling_approx.m clear all ; clc; format long ; N_array = [20, 80, 100, 150, 300, 450]; for i=1:6 %n =input('Enter the integer whose factorial approximation you want to compute: '); n = N_array(i) ; approx_fact = sqrt(2*pi*n)*(n/exp(1))^n fact = factorial(n) error =(fact - approx_fact)/(fact) end