In linux Terminal you can use following statement to compile your program:

g++ -o prog_name my_prog.cpp

and

./prog_name

will execute the program