I wanted to align the four images in a grid of 2x2, but the images are getting arranged vertically. I'm working on a template of IEEE format. This is the code that I'm working on:
\begin{figure}[!tbp]
\centering
\begin{subfigure}{0.25\textwidth}
\includegraphics[width=0.7\linewidth,height=5cm,center]{MobileApp/Menu.png}
\caption{Menu}
\label{fig:menu}
\end{subfigure}
\begin{subfigure}{0.25\textwidth}
\includegraphics[width=0.7\linewidth,height=5cm,center]{MobileApp/Cart.png}
\caption{Cart}
\label{fig:cart}
\end{subfigure}
\begin{subfigure}{0.25\textwidth}
\includegraphics[width=0.7\linewidth,height=5cm,center]{MobileApp/Address.png}
\caption{Address selection}
\label{fig:address}
\end{subfigure}
\begin{subfigure}{0.25\textwidth}
\includegraphics[width=0.7\linewidth,height=5cm,center]{MobileApp/Payment.png}
\caption{Payment screen}
\label{fig:payment}
\end{subfigure}
\caption{Main screens of the application}
\label{fig:main}
\end{figure}
Any suggestions as to what needs to be done to get them arranged in a grid?

\end{subfigure}%(the%is important). – Phelype Oleinik May 03 '19 at 13:34%is important. Essentially, it's because when you have a line break TeX reads it as a space, then the width of the figures plus the space don't fit in the line so TeX breaks the line in that space. Adding the%removes that space so the subfigures are “glued” to each other. – Phelype Oleinik May 03 '19 at 13:42