- Open a file using the command vi filename.c
- Write the c program and save the file
- Compile the program using the command.gcc -o filename filename.cThis command will invoke the GNU C compiler to compile the file and create an executable called filename
- To execute the program type the command ./filename
Example
- vi hello.c
- gcc -o hello hello.c
- ./hello
No comments:
Post a Comment