Re: Help needed




LordOfNoldor wrote:
Is there another way to calculate this without defining a function? By
using intrinsic functions perhaps?

Generate the perfect squares in order, and exclude them from printing.

program non_square

implicit none
integer :: k, n, i

n = 1
k = 1
do i = 1, 100
if (i < k) then
write (unit=*,fmt=*) i
else
n = n + 1
k = n * n
end if
end do

end program non_square

-- epc8 at juno dot com
-- will google eat this post again?

.



Relevant Pages