To run a program in C++ in Mac we have to install Xcode or command-line tools for Xcode . Ways: Hence, there are two options to run a C++ program on Mac. Download and install by using Command Line Tools and using any preferred IDE or Code Editor for writing C or C++ code.