summaryrefslogtreecommitdiffstats
path: root/src/examples/function.ft
blob: 2c6ed7d1c30067e2a23cc1a024e34bbc67f8652f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
program example
real::a
real::root
a=30
root=sqrt(a)
print*,"The square root of ",a," is ",root
end program example

!Function to calculate the square root of a value
function real sqrt(real value)
real::result
result=1
int::count
do count=0,10
result =(result+value/result)/2
end do
return result
end