Created
May 8, 2018 01:55
-
-
Save zrhans/52442a6384e5c2c85582e90d5d4fd2f3 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 volumes | |
implicit none | |
real, parameter :: pi = 3.14159265359 | |
real :: volume = 0.0 | |
integer :: raio | |
! iterando 10 vezes | |
open(unit=10, file='volumes.csv', status='unknown') | |
do raio = 1, 10 | |
! V = 4/3.pi.r^3 | |
volume = (4.0 / 3.0) * pi * raio**3 | |
!Escrevendo na tela | |
!write(*,*)raio, volume | |
! Armazenando em um arquivo | |
write(10,*)raio,',',volume | |
end do | |
close(10) | |
stop 'programa finalizado!!!' | |
end program volumes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment