diff options
| author | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-06 01:32:25 +0000 | 
|---|---|---|
| committer | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-06 01:32:25 +0000 | 
| commit | 4b05cca1920cc10aec16028c96c2899fe45f45c7 (patch) | |
| tree | 45f00b67bf801018f4249c964be73e9312b5ed35 /src/examples | |
| parent | d45507823215cb3e56ac4af181093fad999644aa (diff) | |
| download | esotericFORTRAN-4b05cca1920cc10aec16028c96c2899fe45f45c7.tar.gz esotericFORTRAN-4b05cca1920cc10aec16028c96c2899fe45f45c7.zip | |
Added comment support
Diffstat (limited to 'src/examples')
| -rw-r--r-- | src/examples/example.ft | 29 | 
1 files changed, 13 insertions, 16 deletions
| diff --git a/src/examples/example.ft b/src/examples/example.ft index 3d6f5f2..1d41963 100644 --- a/src/examples/example.ft +++ b/src/examples/example.ft @@ -1,21 +1,18 @@  program example -int::a -int::b -int::c -a=2+3 -b=3 -c=a**b -print*,c - +real::a +real::root +a=25 +root=sqrt(a) +print*,"The square root of ",a," is ",root  end program example - -function int power(int value,int power) -int::i -int::final -final=1 -do i=0,power-1 -final=final*value +!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 final +return result  end
\ No newline at end of file | 
