How to run a C program in Unix terminal?

How to run a C program in Unix terminal ?

1 Like

To run a C program on Unix/Linux/Ubuntu terminal: First You have to compile the code using the following code

gcc -o <File name which you want to assign> <file name>.c

Like if you have a file named “Add.a” then you have to run the following command

      gcc  -o Add Add.c

To run the program you need to write the following command:

./<Assigned filename>

In the case of the above example you need to write :
./Add

1 Like