You are viewing the article How to Write Programs in Notepad at Lassho.edu.vn you can quickly access the necessary information in the table of contents of the article below.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 28,102 times.
This wikiHow teaches you how to use your Windows computer’s Notepad text editor to write programs. To proceed, you need to enter the program’s code into Notepad line by line and then save the file in the appropriate programming language format.
Steps
Some general advice
- By default, all Notepad files will be saved as text documents.
, type notepad , and then select the Notepad icon at the top of the Start window.
- If you don’t know anything about programming languages, you can try one of the examples in this article.
{
or [
), you must close it with the same mark on the opposite side to complete the line of code and not cause an error. - Notepad++ is a great free option for programming.
Create a program
- Batch (BAT) – .bat
- HTML – .htm
- Python – .py
- C++ – .cpp
- For example, to save a batch file with the name “duahau”, enter duahau.bat in the “File name” field.
Create a basic BAT program
Create a basic HTML program
<!DOCTYPE html>
into Notepad and press ↵ Enter . <html>
into Notepad and then press ↵ Enter . <body>
into Notepad and then press ↵ Enter . This line specifies that the next section of the document will contain information (in this example, text). <h1>Text</h1>
into Notepad and press ↵ Enter , remembering to replace “Text” with what you want the page title to be.
- For example, to create a page with the title “Hello!”, you would type
<h1>Xin chao!</h1>
into Notepad.
<p>text</p>
into Notepad and then press ↵ Enter . Don’t forget to replace “text” with your own text.
- For example, when you type
<p>Hom nay ban khoe khong?</p>
into Notepad, the sentence “How were you today?” will appear below the title.
</body>
into Notepad, then press ↵ Enter . </html>
into Notepad. -
<!DOCTYPE html>
-
<html>
-
<body>
-
<h1>Xin chao!</h1>
-
<p>Hom nay ban khoe khong?</p>
-
</body>
-
</html>
Creating a Basic Python Program
print("
into Notepad. Make sure there are no spaces. ")
into Notepad to close the command. -
print("Xin chao!")
Creating Basic C++ Programs
//
along with the title of the program (eg “Program 1”). Anything entered on the same line followed by two slashes will also display as plain text, but this is not part of the program.
- For example, to set the title “Program 1” for the program, you type
//Chuong trinh 1
into Notepad.
# include <iostream>
into Notepad and press ↵ Enter . This command instructs C++ to launch the next lines of code as a program. int main ()
into Notepad, then press ↵ Enter . {
in Notepad and then press ↵ Enter . The main code of the program will be between this opening parenthesis and the following closing parenthesis. std::cout << "Xin chao moi nguoi!";
into Notepad, then press ↵ Enter . }
into Notepad to end the program’s execution phase. -
//Chuong trinh 1
-
#include <iostream>
-
int main ()
-
{
-
std::cout << "Xin chao moi nguoi!";
}
-
std::cout << "Xin chao moi nguoi!";
}
Lưu chương trình . Hãy chắc chắn rằng bạn sử dụng phần mở rộng .cpp khi lưu. Sau khi lưu tập tin, bạn sẽ có thể khởi chạy chương trình bằng trình biên dịch C++ yêu thích. {"smallUrl":"https://www.wikihow.com/images_en/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-460px-Make-a-Program-Using-Notepad-Step-46.jpg","bigUrl":"https://www.wikihow.com/images/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-728px-Make-a-Program-Using-Notepad-Step-46.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class="mw-parser-output"></div>"}
Lưu chương trình . Hãy chắc chắn rằng bạn sử dụng phần mở rộng .cpp khi lưu. Sau khi lưu tập tin, bạn sẽ có thể khởi chạy chương trình bằng trình biên dịch C++ yêu thích. {"smallUrl":"https://www.wikihow.com/images_en/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-460px-Make-a-Program-Using-Notepad-Step-46.jpg","bigUrl":"https://www.wikihow.com/images/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-728px-Make-a-Program-Using-Notepad-Step-46.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class="mw-parser-output"></div>"}
Lưu chương trình . Hãy chắc chắn rằng bạn sử dụng phần mở rộng .cpp khi lưu. Sau khi lưu tập tin, bạn sẽ có thể khởi chạy chương trình bằng trình biên dịch C++ yêu thích. {"smallUrl":"https://www.wikihow.com/images_en/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-460px-Make-a-Program-Using-Notepad-Step-46.jpg","bigUrl":"https://www.wikihow.com/images/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-728px-Make-a-Program-Using-Notepad-Step-46.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class="mw-parser-output"></div>"}
Lưu chương trình . Hãy chắc chắn rằng bạn sử dụng phần mở rộng .cpp khi lưu. Sau khi lưu tập tin, bạn sẽ có thể khởi chạy chương trình bằng trình biên dịch C++ yêu thích. {"smallUrl":"https://www.wikihow.com/images_en/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-460px-Make-a-Program-Using-Notepad-Step-46.jpg","bigUrl":"https://www.wikihow.com/images/thumb/a/ae/Make-a-Program-Using-Notepad-Step-46.jpg/v4-728px-Make-a-Program-Using-Notepad-Step-46.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class="mw-parser-output"></div>"}
Advice
- C++ and HTML are the two most commonly used programming languages.
- You can use any programming language to write most programs, however some languages may be better suited for specific features (for example, HTML is ideal for creating webpage).
Warning
- Always test your code before saving. If you save a corrupted program, it may cause the default assembler to fail.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 28,102 times.
This wikiHow teaches you how to use your Windows computer’s Notepad text editor to write programs. To proceed, you need to enter the program’s code into Notepad line by line and then save the file in the appropriate programming language format.
Thank you for reading this post How to Write Programs in Notepad at Lassho.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: