How to Make a Program Using Notepad
This wikiHow teaches you how to use your Windows computer's Notepad app to create a program. To do this, you'll type a program's code line-by-line into Notepad and then save the Notepad file as the programming language's preferred format....
Part 1 of 6:
Observing Some General Tips
-
Picture 1 of How to Make a Program Using Notepad Understand Notepad's limitations. You can technically write and run a program in Notepad using any coding language available, but you must save the program in the correct format for the program to run.- All Notepad files save as text documents by default.
-
Picture 2 of How to Make a Program Using Notepad Find and open Notepad. The easiest way to open Notepad is by clicking StartPicture 3 of How to Make a Program Using Notepad -
Picture 4 of How to Make a Program Using Notepad Determine your programming language. Notepad doesn't exclude any languages, but you'll need to use the same language throughout the document to remain consistent.- If you don't know any programming languages, you can try one of the examples listed in this article.
-
Picture 5 of How to Make a Program Using Notepad Press ↵ Enter after you complete a line of code. As with most code editors, you'll always need to place new lines of code on a new Notepad line. -
Picture 6 of How to Make a Program Using Notepad Close any open brackets and parentheses. Whenever you open a bracket or parenthesis (e.g.,{
or[
), you must close it with the opposite-facing counterpart in order to complete a line of code. Failing to do so will result in errors. -
Picture 7 of How to Make a Program Using Notepad Consider using a dedicated code-editing program. While you can certainly write entire programs in Notepad, it's definitely not the easiest way—Notepad doesn't contain any syntax highlighting or indentation options, making it difficult to use for writing larger pieces of code.- Notepad++ is a great free option for coding.
Part 2 of 6:
Creating a Program
-
Picture 8 of How to Make a Program Using Notepad Open Notepad. This is how you will create and save any program regardless of the programming language that you use. -
Picture 9 of How to Make a Program Using Notepad Enter your program's code. Make sure that the language you use is consistent throughout the document. -
Picture 10 of How to Make a Program Using Notepad Click File. It's in the top-left corner of the Notepad window. A drop-down menu will appear. -
Picture 11 of How to Make a Program Using Notepad Click Save As…. This option is near the top of the drop-down menu. Doing so opens the "Save" window. -
Picture 12 of How to Make a Program Using Notepad Select a save location. Click a folder (e.g., Desktop) on the left side of the "Save" window to select that folder as your program's destination. -
Picture 13 of How to Make a Program Using Notepad Click the "Save as type" box. You'll find it near the bottom of the "Save" window. This prompts a drop-down menu. -
Picture 14 of How to Make a Program Using Notepad Click All Files. It's in the drop-down menu. This option allows you to save the Notepad file as any type of program. -
Picture 15 of How to Make a Program Using Notepad Enter a name for your program. Click the "File name" text field and enter your preferred name for your program. -
Picture 16 of How to Make a Program Using Notepad Add the program's extension to the name. Regardless of the program's name, you'll need to place a period and the programming language's extension tag after the name in order for the program to be saved correctly. Common programming languages and their extensions include the following:- Batch (BAT) - .bat
- HTML - .htm
- Python - .py
- C++ - .cpp
- For example: to save a batch file as "watermelons", you would type watermelons.bat into the "File name" field.
-
Picture 17 of How to Make a Program Using Notepad Click Save. It's in the bottom-right corner of the window. Doing so saves your program in your selected format. You can run it by double-clicking it, though you may need to select a program in which to open it after doing so.
Part 3 of 6:
Creating a Basic BAT Program
-
Picture 18 of How to Make a Program Using Notepad Open Notepad. You can create a program that opens another program on your computer using a batch (BAT) script. -
Picture 19 of How to Make a Program Using Notepad Enter the Command Prompt file's name. Type cmd.exe into Notepad. -
Picture 20 of How to Make a Program Using Notepad Save your program. Make sure that you use the .bat extension when saving. -
Picture 21 of How to Make a Program Using Notepad Double-click your BAT file. Doing so will open a new Command Prompt window.
Part 4 of 6:
Creating a Basic HTML Program
-
Picture 22 of How to Make a Program Using Notepad Open Notepad. Especially if you're designing a webpage, HTML is a great language to use. -
Picture 23 of How to Make a Program Using Notepad Indicate that you'll be using HTML. Typeinto Notepad and press ↵ Enter.
-
Picture 24 of How to Make a Program Using Notepad Add the HTML tag. Typeinto Notepad and press ↵ Enter.
-
Picture 25 of How to Make a Program Using Notepad Set up the body text section. Typeinto Notepad and press ↵ Enter. This line indicates that the following part of the document will contain a section of information (in this case, text).
-
Picture 26 of How to Make a Program Using Notepad Add a page heading. TypeText
into Notepad and press ↵ Enter, making sure to replace "Text" with whatever you want your page header to be.- For example: to create a page with the heading "Hello!", you would type
Hello!
into Notepad.
- For example: to create a page with the heading "Hello!", you would type
-
Picture 27 of How to Make a Program Using Notepad Add text to your page. Typetext
into Notepad and press ↵ Enter. Make sure that you replace "text" with your preferred text.- For example, you would type
How are you today?
into Notepad to display the phrase "How are you today?" below the heading.
- For example, you would type
-
Picture 28 of How to Make a Program Using Notepad Close the body section. Typeinto Notepad, then press ↵ Enter.
-
Picture 29 of How to Make a Program Using Notepad Indicate the end of the HTML coding. Typeinto Notepad.
-
Picture 30 of How to Make a Program Using Notepad Review your program's code. It should look something like this:-
Hello!
-
How are you today?
-
Picture 31 of How to Make a Program Using Notepad Save your program. Make sure that you use the .htm extension when saving. -
Picture 32 of How to Make a Program Using Notepad Double-click the HTML file. Doing so will usually open it in your default web browser, though you may have to select a program first. You should see your heading and its text displayed.
Part 5 of 6:
Creating a Basic Python Program
-
Picture 33 of How to Make a Program Using Notepad Open Notepad. Using the "print" command in Python, you can display any text that you want to. -
Picture 34 of How to Make a Program Using Notepad Enter the "print" command. Typeprint("
into Notepad. Make sure that there aren't any spaces when you do this. -
Picture 35 of How to Make a Program Using Notepad Add text to display. Type Hello! into Notepad. -
Picture 36 of How to Make a Program Using Notepad Close the "print" command. Type")
into Notepad to close the command. -
Picture 37 of How to Make a Program Using Notepad Review your code. It should look something like this:print("Hello!")
-
Picture 38 of How to Make a Program Using Notepad Save your program. Make sure that you use the .py extension. You should now be able to open the program in your preferred Python editor.
Part 6 of 6:
Creating a Basic C++ Program
-
Picture 39 of How to Make a Program Using Notepad Open Notepad. You'll be using Notepad to create a basic C++ program that displays "Hello World!" when run. -
Picture 40 of How to Make a Program Using Notepad Add a title to your program. Type in//
followed by your program's title (e.g., "My first program"). Any text in a line that's typed after two slash marks will show up as plain text (e.g., not part of the program).- For example: to entitle your program "Program 1", you'd type
//Program 1
into Notepad.
- For example: to entitle your program "Program 1", you'd type
-
Picture 41 of How to Make a Program Using Notepad Enter the preprocessor command. Type#include
into Notepad, then press ↵ Enter. This command instructs C++ to run the following lines of code as a program. -
Picture 42 of How to Make a Program Using Notepad Declare the program's function. Typeint main ()
into Notepad, then press ↵ Enter. -
Picture 43 of How to Make a Program Using Notepad Add an open bracket. Type{
into Notepad, then press ↵ Enter. Your program's main code will go between this open bracket and a closed bracket later. -
Picture 44 of How to Make a Program Using Notepad Enter your program's execution code. Typestd::cout << "Hello World!";
into Notepad, then press ↵ Enter. -
Picture 45 of How to Make a Program Using Notepad Add a closed bracket. Type}
into Notepad. This closes the program's execution phase. -
Picture 46 of How to Make a Program Using Notepad Review your program. It should look something like this://Program Title
#include
int main ()
{
std::cout << "Hello World!";
}
9
- Save your program. Make sure that you use the .cpp extension when doing so. Once you've saved the program, you should be able to run it in your preferred C++ compiler.
Picture 47 of How to Make a Program Using Notepad License: Fair Use (screenshot)
n
Tips
- C++ and HTML are two of the most commonly used programming languages in existence.
- You can use virtually any programming language to create most programs, though some languages are better-suited to specific functions (e.g., HTML is ideal for creating webpages).
Warnings
- Always check your code before saving it. Saving a broken program can cause issues with your default program compiler.
- Use the Command Prompt and Write in Batch Language
- Build a Simple Computer Game Using Batch Script
- Create a Simple CSS Stylesheet Using Notepad
- Make a Simple Mod of a Game
- Build a Simple Calculator Using Batch Script
1. Open Notepad.
2. Enter your program's code.
3. Click File, then click Save As....
4. Click the "Save as type" drop-down box, then click All Files.
5. Type the program's extension (e.g., ".html") at the end of the name in the "File name" text box.
6. Click Save.
Update 05 March 2020
You should read it
- How to create an Excel formula in Notepad ++
- How to Create and Manage a Hidden Account in Windows 7
- Use Notepad to make the keyboard automatically type any text repeatedly
- How to Use Notepad++
- What is Notepad ++? Compare Notepad ++ and regular Notepad
- These 'hack' tips are only Notepad can do
- How to quickly open the data file with the Notepad editor
- How to activate and experience the new interface of Notepad in Windows 11
- Summary of useful shortcuts when using Notepad
- Steps to find and replace text in Notepad on Windows 10
- Tips to set an encryption password for NotePad files
- Reset Notepad to the initial default setting state
Maybe you are interested
Each person's eye color is different from anyone else's, why is that? The easiest way to Use Macros in Excel What is Miracast Connect? On which device? Instructions on how to use Miracast Top 10 best anime movies 2020 - 2021 Hackers are taking advantage of the Store to distribute malware Clean your oven without harsh chemicals