\documentclass[11pt]{article}
\usepackage{mathptmx,helvet,courier,bm}
\usepackage{amsmath,amssymb,stmaryrd}
\usepackage[sort&compress,numbers]{natbib}
\usepackage{algorithmic,listings}
\lstloadlanguages{C}

% make the page wider, taller and fit floating figures better
\addtolength{\oddsidemargin}{-.5in}
\addtolength{\evensidemargin}{-.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.85in} 
\addtolength{\headsep}{-.1in}
\addtolength{\textheight}{1.5in}
\renewcommand{\topfraction}{.9}
\renewcommand{\textfraction}{.01}
\renewcommand{\floatpagefraction}{.99}
\addtolength{\textfloatsep}{-10pt}
\setcounter{bottomnumber}{2}
\renewcommand{\bottomfraction}{.95}
\renewcommand{\topfraction}{.99}


\begin{document}
\sloppy

\begin{center}
{\Large \textbf{Computer Science}}\\
Don H. Johnson\\
\today
\end{center}

Algorithms can be made to look pretty with the \texttt{algorithmic} package.
\begin{center}
\begin{algorithmic}
\IF {$i\leq0$} \STATE $i\gets1$ \ELSE
\IF {$i\geq0$} \STATE $i\gets0$ \ENDIF
\ENDIF
\end{algorithmic}
\end{center}

Program listings can take into account the language being used with the \texttt{listings} package.

\lstset{language=C}
\begin{lstlisting}
int sum;
int i;  /* for loop variable */
sum = 0;
for (i = 0; i < n; i++) {
   sum += a[i];
   }
\end{lstlisting}

\end{document}