Review C language with simple and straight to the point codes.
To compile C source code use gcc (pre-installed in most, if not all, linux distributions and mac OS):
gcc YOUR_SOURCE_CODE.c -o YOUR_DESIRED_OUTPUT_MACHINE_CODE_FILE.out
To run your just compiled code, run it using:
./YOUR_DESIRED_OUTPUT_MACHINE_CODE_FILE.out