summaryrefslogtreecommitdiffstats
path: root/src/examples/example.ft
blob: 1d419633071cce518f7897f02bdc390ebede0600 (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=25
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