[latex] How to put a symbol above another in LaTeX?

How to put a symbol above (on the head of) another? For example, I want to produce something like this in one line.

a
#

i.e., a above #.

The effect should be almost the same with $#^a$ except that a is on the top instead of top right of #.

This question is related to latex

The answer is


${a \atop \#}$

or

${a \above 0pt \#}$

If you're using # as an operator, consider defining a new operator for it:

\newcommand{\pound}{\operatornamewithlimits{\#}}

You can then write things like \pound_{n = 1}^N and get:

alt text