diff options
author | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-05 03:27:18 +0000 |
---|---|---|
committer | AidenRushbrooke <72034940+AidenRushbrooke@users.noreply.github.com> | 2021-12-05 03:27:18 +0000 |
commit | 9e6c89f1fa93287104381e02f0bbbdd6060a9382 (patch) | |
tree | 65a26fbbccb0172805b131b7100ffcabb7790da3 /src/examples | |
parent | 43909b350b9084ed33f121a15c5770224cbdc79f (diff) | |
download | esotericFORTRAN-9e6c89f1fa93287104381e02f0bbbdd6060a9382.tar.gz esotericFORTRAN-9e6c89f1fa93287104381e02f0bbbdd6060a9382.zip |
Added subroutines and comments for most files
Diffstat (limited to 'src/examples')
-rw-r--r-- | src/examples/example.ft | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/examples/example.ft b/src/examples/example.ft index 4a4981a..ab5143d 100644 --- a/src/examples/example.ft +++ b/src/examples/example.ft @@ -1,15 +1,20 @@ program example -int ::test -int::testtwo -test=5 -testtwo=7 -int::testthree -testthree=add(test,testtwo) -print*,testthree +int::a +int::b +int::c +a=2+3 +b=3 +c=power(a,b) +print*,c end program example -function int add(int a, int b) -int::value -value=a+b -return value + +function int power(int value,int power) +int::i +int::final +final=1 +do i=0,power-1 +final=final*value +end do +return final end
\ No newline at end of file |