\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{c}
  int main() {
    printf("hello, world");
    return 0;
  }
\end{minted}
\end{document}