FIBONACCI IN FORTRAN
1.
PROGRAM
FIBONACCI
The piece
of code below is meant to execute Fibonacci expression from 1 – 10
program fibonacci
!this program will print
fibonacci expression from 1 to 10
integer :: a,b,c,e
print*, 'Please enter you
first after 1
read*, a
print*, 'Please enter your
common ratio after 1'
read *, b
print*, 'Please enter your
last term'
read *, c
e=1
e=e*b
print *, 0
print *, 1
print *, 1
do i=a,c,e
write (*,*) i
end do
end program Fibonacci
Comments
Post a Comment