
If you use any IDE, then it will help you to resolve compilation errors easily and also increases coding efficiency.īelow is the sample C program that we will execute using command prompt. c extension by using any text editor or IDE to write your program. Prerequisite 2: C program with required file extension You must download and Install gcc compiler on your computer by clicking here. Some of them are free and to use and some are paid.Īs an example, we will use gcc compiler to compile C program. You need to choose the compiler based on the programming language you are using. For different programming languages, different compilers are available in the market. To compile any program, you need to have a suitable compiler installed on your development environment. Prerequisite 1: Download and Install a compiler To run your C program using cmd, here are the prerequisites for Windows. Prerequisites before compiling and running any C program using command prompt: At the end of this article, you will be able to execute your C program successfully using command prompt without any error.

Before you move ahead with the steps, you must complete below 2 prerequisites in order to facilitate smooth execution of these 4 steps.

This article covers 4 simple steps to compile and run a C program in command prompt on Windows.
