how to execute c++ program in cmd

g++ filename.cpp -o filename.exe