OneCompiler

Latex 11

1636

\documentclass{article}

\newcommand{\que}{\mathord{?}}

\usepackage{algorithm, algpseudocode}
\pagestyle{plain}
\title{Algorithm to find a number is positive or negative}
\date{}
\begin{document}
\maketitle
\begin{algorithm}[H]
\caption{Algorithm to check the sign of a number}\label{euclid}
\begin{algorithmic}[1]
\Procedure{}{}\newline
\textbf{Input:} Read the number from user console\newline
\textbf{Output:} Display the sign of the given number\newline
\State{Read the number num}
\State{if num >> zero}
\State{num is positive}
\State{else if num<< zero}
\State{num is negative}
\State{else num is zero}
\EndProcedure
\end{algorithmic}
\label{alg_1}
\end{algorithm}
\end{document}