

This is done by simply giving the name of the executable file without any extension. In the next step, we can run the program. Eg: Armstrong.exe STEP 5: Run the Program In our case, we will use Armstrong.c.Īfter this, an executable file will be created in the directory that your c file exists in.

To do this we need to use the command gcc followed by the name of the program we are going to execute. Our program is already in the user directory so, we don’t need to change it. We need to pass the name of the directory in which the program is stored. You can do that by using the command ‘ cd’, which changes the directory. Printf("%d is not an Armstrong number.",num) Ĭhange the working directory to where you have your C program. Printf("%d is an Armstrong number.",num) I have written a program to find the Armstrong Number and store it in the directory user. STEP 2: Create the ProgramĬreate a c program and store it in your system. You can search for cmd in your windows system to open the command prompt. If not you need to download a gcc compiler and install it. Run the command ‘gcc -v’ to check if you have a compiler installed.
#CMD C START LOW HOW TO#
So let us get with this article on how to compile C progam in command prompt, How to Compile C Program in Command Prompt? STEP 1: Check for Compiler In this article we would be understanding how to compile C program in command prompt. The command prompt has a set of steps we need to perform in order to execute our program without using a GUI compiler. We usually use a compiler with a graphical user interface, to compile our C program.
