Last active
May 21, 2016 19:28
-
-
Save zrhans/ade57b1ccf74c619036580ae9a92fdca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program fatorial | |
implicit none | |
! define variaveis | |
integer :: nfact = 1 | |
integer(kind=1) :: n | |
! calculando o fatorial | |
print*,' n | FATORIAL' | |
print*,'========================' | |
do n = 1,20 | |
nfact = nfact * n | |
! mostrando valores de n e seu fatorial | |
if (n == 8) cycle | |
if (nfact < 0 ) stop 'Limite do tipo Integer alcaçado.' | |
print*,n, nfact | |
end do | |
end program fatorial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment