Fortran: Lesson 3

Lesson topics

View Demos
# 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9
# 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9

Demo 4

								        program demo4
c       This program will not compile, because the cosine, as with most
c       Fortran functions, cannot be applied to integers. The program
c       will work if you replace cos(n) with cos(real(n)).
integer n
do n = 1, 10
print *, cos(n)
end do
end