Factorial of a Number | FORTRAN 95

Factorial of a Number | FORTRAN 95

PROGRAM factorial
  IMPLICIT NONE
  INTEGER::n,i,fact1=1

  PRINT *, '============================================'
  PRINT *, 'PROGRAM TO CALCULATE FACTORIAL OF A NUMBER [ BY WWW.BOTTOMSCIENCE.COM ]'
  PRINT *, '============================================'
  
  PRINT *, 'Enter a Number to Calculate it''s Factorial'
  READ(*,*) n

  DO i=1,n
    fact1=fact1*i
  END DO
  PRINT *,'Factorial is',fact1

END PROGRAM

OUTPUT

OUTPUT – FACTORIAL | FORTRAN 95

Leave a Reply

Your email address will not be published.