\newif\ifanswers\answerstrue % the logic variable is default to false, set it to true here\documentclass{article}\begin{document}Question\ifanswersAnswer\fi\end{document}
Use ifdefined
\documentclass{article}%\newcommand*{\DEBUG}{}%\begin{document}\ifdefined\DEBUG DEBUG was on\else DEBUG was off\fior\ifx\DEBUG\undefined DEBUG was off\else DEBUG is on\fi\end{document}