0

I'm writing simple program in c++ using netbeans. I want it should be executable thru ubuntu terminal as other do

like "php samel.php" it works I want something like this

please guide me how to do this

1 Answers1

0

Firstly, save your code in form of a file. Let's say the file name is xyz.c Open the terminal and change the directory to the location where your file is(use cd command). After that compile as g++ xyz.c This will compile your code. Doing that will produce an executable file a.out, which you can run by typing ./a.out

Mudit Kapil
  • 2,051
  • 7
  • 30
  • 47