The commands perform the following actions:
-
gcc test.c -o test:- This command compiles the C source file named
test.cusing the GCC compiler. - The
-o testoption specifies that the output executable should be namedtest. If this option is not provided, the default output name would bea.out. - After running this command, if there are no errors in the source code, an executable file named
testwill be created.
- This command compiles the C source file named
-
./test:- This command runs the compiled executable named
test. - The
./indicates that the executable is located in the current directory.
- This command runs the compiled executable named
In summary, the first command compiles the C program, and the second command executes the compiled program.
