program sumofnumdivisibleby17
implicit none
integer :: i, j
j = 0
do i=1000,680000
if (i % 17 = 0)
j += i
end if
end do
write(*,'(A,I10)') 'Sum of the numbers from 1000 to 680000 that are divisible by 17 is:', j
end sumofnumdivisibleby17
program sumofnumdivisibleby17
implicit none
integer :: i, j
j = 0
do i=1000,680000
if (i % 17 = 0)
j += i
end if
end do
write(*,'(A,I10)') 'Sum of the numbers from 1000 to 680000 that are divisible by 17 is:', j
end sumofnumdivisibleby17
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.