An element or an ideal of a commutative ring is nilregular if and only if

it is regular modulo the nilradical. We prove that if the ring is

Noetherian, then every nilregular ideal contains a nilregular element. In

constructive mathematics, this proof can then be seen as an algorithm to

produce nilregular elements of nilregular ideals whenever the ring is coherent,

Noetherian, and discrete. As an application, we give a constructive proof of

the Eisenbud--Evans--Storch theorem that every algebraic set in

$n$--dimensional affine space is the intersection of $n$ hypersurfaces.

The input of the algorithm is an arbitrary finite list of polynomials,

which need not arrive in a special form such as a Gr"obner basis.

We dispense with prime ideals when defining concepts or carrying out proofs.