To compile c program, use the command " cc *.c".

To compile a c++ program, use the command "CC *.C" or "CC *.cc".

Both compilation will produce an executable file a.out that can be submitted to run.

To link to the math library, use the command "cc prog.c -o prog -lm" which compiles prog.c, links to math library and produces an executable file prog.