- #1
zandria
- 15
- 0
I am working with visual Fortran (f90 I believe)
I have the following program and it says that I have 2 errors. I have narrowed it down to having something to do with my loop statement in bold. Is there something wrong that I'm not getting?
program exercise1
implicit none
integer :: limit, f1, f2, f3
read*, limit
f1 = 1
if (limit >= 1) then
print*, f1
end if
f2 = 1
if (limit >= 2) print*, f2
do i= 3, limit
f3 = f1 + f2
print*, f3
f1 = f2
f2 = f3
end do
end program exercise1
I have the following program and it says that I have 2 errors. I have narrowed it down to having something to do with my loop statement in bold. Is there something wrong that I'm not getting?
program exercise1
implicit none
integer :: limit, f1, f2, f3
read*, limit
f1 = 1
if (limit >= 1) then
print*, f1
end if
f2 = 1
if (limit >= 2) print*, f2
do i= 3, limit
f3 = f1 + f2
print*, f3
f1 = f2
f2 = f3
end do
end program exercise1