program factorial implicit none integer::i,n,factor print *, "input the limit to calculate factoriel of numbers from 2 ~ limit:" read *,n if (n<2) then print *,'the number is less than 2.' else factor = 1 do i =2,n factor = factor*i print*,i,'!=',factor end do end if end program factorial