How to Compile and Run a C++ Program Using g++ on Ubuntu 18.04 LTS?<br /><br />Step 1: To check whether you have g++ installed or not on your ubuntu, Open 'Terminal.'<br /><br />Step 2: Type the command below, and then hit enter.<br /><br /> g++ --version<br /><br /> If you get version info of g++ that means you g++ installed. if you get error like that 'command not found' or 'command not recognized' that means you don't have g++ installed.<br /><br /> Type the command below to install g++, and then hit Enter:-<br /><br /> sudo apt install build-essential<br /><br /> follow the instructions on terminal, and install it.<br /><br />Step 3: Now, go to the Directory where you have your C++ program file. After that type the command below to compile it, and hit enter.<br /><br /> g++ your_c++_Program_filename -o filename_that_you_want_to_give<br /><br />Step 4: To run it, type the command below, and then hit enter.<br /><br /> ./filename_that_you_have_given<br /><br /><br />It's done.<br /><br /><br /><br /><br />Thanks for watching, please like and subscribe <br /><br />==============================================<br />https://www.facebook.com/HowtoTutorialsByAmit/<br />