Solution (source code)

= Solution

Take the union of $n$ distinct projective lines in general position, with no three concurrent. Its defining polynomial is the product of their linear equations, so its degree is $n$. Exactly two lines meet at each of the $\binom n2$ pairwise intersections, producing an ordinary double point; elsewhere just one line passes through and the curve is smooth. Hence
$$
\boxed{\#\operatorname{Sing}(C)=\binom n2=\tfrac12n(n-1).}
$$
For $n=1$, the line itself gives zero singular points, as required.