Have you ever thought that you could write a C program in Notepad and execute it without the use of the traditional C language software. Then, the Notepad++ software provides you with the solution.
Notepad++ is a source code editor that replaces the traditional Notepad. It supports a wide variety of programming languages like C, C++, C#, java, Cobol, HTML, shell programming etc. in this tutorial, we will guide you on how to Compile and run a C program using the Notepad++ software.
The Notepad++ software.
An External Compiler called Dev-C++
Download the above software from the following links
The following section describes you with a step-by-step instruction of how to install the Notepad++ software on Windows operating system
1) Download the Notepad++ software from the above mentioned link.
2) Click on the npp.exe file to start the installation process.
3) In the next step, select the language that you wish to use throughout the installation process and click on OK.
4) In the Notepad++ setup wizard thus opened, click on the Next button to continue the installation process.
5) In the next step of the wizard, you have to accept the License agreement by clicking on the I Agree button.
6) In the next step, you have to choose a location or a destination folder where you would like to install the software. Select a location of your wish using the Browse button and click on the Next button.
7) In the next step of the Wizard, click on the Install button.
8) The installation process will take a few seconds to complete and during the course of installation, the following progress window will be displayed on your screens.
9) Once the installation is complete, click on the Finish button.
Similarly, install the Dev-C++ compiler using the following steps
1) Download the software from the above mentioned link.
2) After downloading, click on the devcpp.exe file to start the installation process.
3) Select the language of installation and click on OK.
4) In the next step, accept the License agreement by clicking on the I Agree button.
5) In the next step, click on the Next button to continue with the installation process.
6) In the next step, select the directory where you would like to install the Dev-C++ compiler. Use the default directory that is recommended by the installation wizard and click on the Install button.
7) The installation process may take a few minutes to complete and once the installation is complete, click on the Finish button.
If you are installing the compiler for the very first time, then you should carry on with some additional steps to configure the compiler.
8. Once you click on the Finish button, a Dev-C++ first time configuration window appears on your screen. In this window, click on the Next button.
9) In the next step, select the radio button that says No, I prefer to use Dev-C++ without it and click on the Next button.
10) In the next step, click on OK to configure the compiler successfully.
Now, as you have both the software ready with you, the next thing is to execute a C program in the Notepad++ with the help of Dev-C++ compiler. The following steps show you how.
1) Launch the Notepad++ application by clicking on the Notepad++ icon present on the Start menu.
2) In the Notepad++ main window thus opened on your screen, click on the File tab and select New. This will open a new document on your screen where you can write the C program.
3) In the next step, you have to select the language in which you want to write the program. To select the C language, click on the Language tab and then point you mouse over C and select C from the context menu.
4) In the next step, write the C program that you wish to execute in the Notepad++. In our illustration, we are choosing a simple C program that prints the text blog.itechtalk.com as the output. See the snapshot below for details.
5) In the next step, you have to save the program. To do so, click on the File tab and select Save As from the context menu.
6) In the Save As dialogue box thus opened, click on the Save as type box and select C source file (*.c) as the file extension and click on the Save button.
7) Now, click on the Run tab and then select Run from the drop down menu. This will open up the Run dialogue box on your screens.
8) In the Run dialogue box, click on the Browse button to select the program file that you saved in the step 6 above.
9) In the window thus opened, select the file that you saved and click on Open.
10) In the next step, in the Run dialogue box. Click on the Run button. This will open up your C program in the Dev-C++ compiler.
11) In the Dev-C++ compiler, click on the Execute button and then select Compile from the context menu. This will compile your C program and display any errors if present at the bottom of the window. See the screenshots below for details.
12) If the compilation process is successful, you will see the following dialogue box on your screen. Click on the Close button to exit from the dialogue box.
13) Now, you have to Run the program. To do so, click on the Execute tab and select Run from the drop down menu.
14) Now, you should see the output of your program on your screen which will appear as follows.
I know you can’t wait any longer to execute this on your system using the Notepad++.