Question: How to Compile C Program in Windows?
Contents

How to Run C-Program in Command Prompt

  • Step0: Install C-Program Compiler (gcc) You will need a C compiler to do this already installed, I use GCC.
  • Step1: Create Your C-Program.
  • Step2: Open Command Prompt/Line.
  • Step3: Go to the Source Code Directory.
  • Step4: Compile the Source Code.
  • Step4.1: Compile the Source Code.
  • Step5: Run Your Program !

How do I compile C in Windows?

Create a C source file and compile it on the command line

  1. In the developer command prompt window, enter cd c:\ to change the current working directory to the root of your C: drive.
  2. Enter notepad simple.c at the developer command prompt.
  3. In Notepad, enter the following lines of code:

How can you compile and run the C program?

This document shows how to compile and run a C program on Ubuntu Linux using the gcc compiler.

  • Open up a terminal. Search for the terminal application in the Dash tool (located as the topmost item in the Launcher).
  • Use a text editor to create the C source code. Type the command.
  • Compile the program.
  • Execute the program.
Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest