How to compile this C program?

QuestionsQuestions8 SkillsProData Stream RedirectionNov, 27 2025
0125

To compile the C program you created in test.c, follow these steps:

  1. Open your terminal.

  2. Navigate to the directory where the test.c file is located. If it's in the Documents directory, you can use:

    cd ~/Documents
  3. Compile the program using gcc:

    gcc test.c -o test

    This command compiles test.c and creates an executable named test.

  4. Run the compiled program:

    ./test

You should see the output:

hello world

Let me know if you need further assistance!

0 Comments

no data
Be the first to share your comment!