I am new in TeXstudio editor and I want to add an arrow with words above to show a transition between two states. Something like the picture below.

How can I do that.
I am new in TeXstudio editor and I want to add an arrow with words above to show a transition between two states. Something like the picture below.

How can I do that.
You could use mathtools.
\documentclass{article}
\usepackage{mathtools}
\begin{document}
$\xrightarrow{print(5)}$
\end{document}