Basic Programs who just start learning C. :D
- COPY THE CODE FROM THE FILE.
- OPEN YOUR C COMPILER & PASTE IT AND RUN IT :)
- COPY THE CODE FROM THE FILE.
- PASTE IT IN NOTEPAD.
- SAVE THE FILE AS xxx.C
-
OPEN TERMINAL(CMD)
-
Run the command ‘gcc -v’ to check if you have a compiler installed. If not you need to download a gcc compiler and install it. You can search for cmd in your windows system to open the command prompt.
-
Change the working directory to where you have your C program. You can do that by using the command ‘cd’, which changes the directory. We need to pass the name of the directory in which the program is stored.
-
The next step is to compile the program. To do this we need to use the command gcc followed by the name of the program we are going to execute. In our case, we will use helloworld.c.
-
In the next step, we can run the program. This is done by simply giving the name of the executable file without any extension. On giving this we will get an output. Here, our Armstrong code is executed and we got output for this code.
-
reference website: https://www.edureka.co/blog/how-to-compile-c-program-in-command-prompt/
-
online c compiler: https://www.onlinegdb.com/online_c_compiler
Author: Subhranshu Sekhar Choudhury :D
PUBLISHED ON: 15 JULY 2021