The best and easiest way to run C++ Programms is to use an IDE.
You can download Visual Studio Code from the below link :
Once Visual Studio Code is downloaded and installed, now it's time to Download and install a C++ compiler
And MinGW provides a development environment. You cann download it from the below link
Once MinGW is installed. The 'MinGW Installation Manager' screen shows up. In the 'MinGW Installation Manager' window, click on mingw32-gcc-g++ then select 'Mark for Installation'.
In the top left corner, click on Installation -> Apply Changes
After you have installed MinGW, ypu can find it in C:\MinGW\bin. Then you need to add it to your environmental variable path.
Now you can open 'Visual Studio Code' and go to extensions.
Then you can select 'C/C++' extension. And click on 'install' to install the extension.
Now open command prompt and create a folder called CPlusPlus in any of your drive.
Now type 'code .' and that will open VS Code in the current folder(i.e. CPlusPlus)
And VS Code is opened and the folder CPlusPlus becomes your 'workspace'
Then you create a file named 'helloworld.cpp' under the CPlusPlus folder. And type the below code.
And you are all set.