summaryrefslogtreecommitdiffstats
path: root/src/examples/example.ft
blob: 571cace399393bae04fa42a62370d341f4f4c2fe (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(25+5)
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