To compile a C program using GCC, you can use the following syntax in the terminal:
gcc filename.c -o outputname
filename.cis the name of your C source file.-o outputnamespecifies the name of the output executable file. If you omit this option, the default output file will be nameda.out.
For example, to compile a file named user_input.c and create an executable named user_input, you would use:
gcc user_input.c -o user_input
