Fortran: Lesson 3

Lesson topics


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

Demo 2

								        program demo2
c       This program will not compile because, as with most Fortran 
c       functions, sqrt cannot be applied to integers. To compile
c       the program, comment out the first print statement.
        print *, "sqrt(4) = ", sqrt(4)
        print *, "sqrt(4.) = ", sqrt(4.)
        print *, "real(4) = ", real(4)
        print *, "sqrt(real(4)) = ", sqrt(real(4))
        end