\documentclass[12pt]{article} \usepackage{ifthen}
%\documentstyle[12pt,ifthen]{article}
\parindent 0mm
\begin{document}

\section*{1st Example:}
\newcounter{number}
\whiledo{\value{number} < 9}
  {\stepcounter{number}step \arabic{number}\newline}

\section*{2nd Example:}
\newcommand{\na}[2]{\ifthenelse{\equal{#1}{1}\or\equal{#1}{4}} {} {\par #1 #2} }
 \na{3}{123}
 \na{1}{456}
 \na{3}{789}
 \na{2}{012}
 \na{4}{345}
 \na{3}{678}

\section*{3rd Example:}
\newcommand{\outputline}{yes}
\newcommand{\nb}[2]{\ifthenelse{\equal{#1}{1}\or\equal{#1}{4}}
          {\renewcommand{\outputline}{no}} {\par #1 #2 \renewcommand{\outputline}{yes}} }
\newcommand{\st}[2]{\ifthenelse{\equal{\outputline}{yes}} {: #1 #2} {} }
 \nb{3}{123}\st{ack}{280}
 \nb{1}{456}\st{bck}{285}
 \nb{3}{789}\st{dck}{283}
 \nb{2}{012}\st{eck}{288}
 \nb{4}{345}\st{ick}{281}
 \nb{3}{678}\st{jck}{284}

\end{document}
