Ily, Fortran also supports many vector (array) operations. For example, your task can be accomplished without writing any function body:
program main
real, allocatable :: x(:), y(:)
x = [2.0,4.0,5.0]
y = x*x*0.5
print *,y
end
Ily, Fortran also supports many vector (array) operations. For example, your task can be accomplished without writing any function body:
program main
real, allocatable :: x(:), y(:)
x = [2.0,4.0,5.0]
y = x*x*0.5
print *,y
end