On nonlinear complementarity problems with applications