Type the following program exactly as shown:
! This program generates a table of the square roots of integers
! in a user-specified range.
program squares
implicit none
integer*2 start, finish, i
! ----------------------------------------------Prompt and Input
print*, "Enter the range (two integers) ..."
read*, start, finish
! ----------------------------------------------Validation & Processing
if (start .GT. finish) then
print*, "Invalid: the start must be less than the end value!"
else if (start .LT. 0) then
print*, "Invalid: the range must not have negative values!"
else
do i = start, finish
write(*,*) i, sqrt(i*1.)
end do
end if
! ----------------------------------------------
end