Silverfrost Forums

Welcome to our forums

error executing a program!

19 Jan 2012 12:44 #9475

implicit none integer :: i, f, Factorial print*, 'type in the number, integer only' read*, i do while(i<0) print*, 'factorial only defined for positive integers: Re-input' read*, i enddo f=Factorial(i) print*, 'answer is', f

end

error!

WARNING the following symbols are missing: FACTORIAL C:\project2\lgotemp@.obj (C:\PROJECT2\FUNCTION2.F95) Creating executable: C:\project2\function2.EXE

pls help, can't figure out the problem. thanks

19 Jan 2012 6:06 #9476

Factorial is not known to the compiler and it assumes that it is an external function. You can supply Fortran code to define Factorial.

After your end statement you need something like

integer function Factorial(i) integer i ! Some code to calculate the result Factorial = result end

Please login to reply.