function S(a,b) 
    real(8) :: S
    integer :: a,b
    integer :: c1 = 0
    real(8) :: c2=1.0,c3=0.0,c4=0.0,c5=0.0
    do while (c1 < b)
        c5 = 0
        do while (c5 < a)
             c3 = c4
             c4 = c4 + c2
             c5 = c4 * c4
        end do
        c4 = c3
        c2 = c2 * 0.1
        c1 = c1 + 1
    end do
    S = c4
end function S

program main
    real(8) :: S
    print *, S(2,10)
end program main

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: