1 Write the code segment that does the following opens a fil
1. Write the code segment that does the following: opens a file named MyName.txt, writes your first name to the file, and then closes the file. 2. Write the code segment that does the following: opens a file named MyName.txt, reads the first line from the file and displays it, and then closes the file.
Solution
it is generally called text or doc file of a programme.
filename (also written as two words, file name) is a name used to uniquely identify a computer file stored in a file system. Different file systems impose different restrictions on filename lengths and the allowed characters within filenames.
A filename may include one or more of these components:
The components required to identify a file varies across operating systems, as does the syntax and format for a valid filename.
Discussions of filenames are complicated by a lack of standardisation of the term. Sometimes \"filename\" is used to mean the entire name, such as the Windows name c:\\directory\\myfile.txt. Sometimes, it will be used to refer to the components, so the filename in this case would be myfile.txt. Sometimes, it is a reference that excludes an extension, so the filename would be just myfile.
No2) In HTML tags
.txt is the extension name of the perticular code.
Open a wordpad file or any wordprocessor file .
<html>
<head>welcome </head>
<title>MYName.Txt</title>
</html>
write the prog in text format
run the programme or extrension of the prog.html.

