module Module5Task6
contains
	function root(a,k,eps)
		implicit none
		integer (kind=4), intent(in), optional :: k
		real(kind=8), intent(in), optional :: eps
		real(kind=8), intent(in) :: a
		real::root
		real(kind=8) :: y,y1,pr
		integer (kind=4)::order
		if (present(k)) then 
			order=k
		else
			order=2
		end if
		if (present(eps)) then 
			pr=eps
		else
			pr=0.00001
		end if
		y=0.0
		y1=1.0
		do while (abs(y1-y)>pr)
			y=y1
			y1=y+((a/(y**(order-1)))-y)/order
		end do
		root = y1
	end function root

end module Module5Task6