How to write a C++ Program to write numbers one to hundred in a data file notes.txt in C++ Programming.
![]() |
C++ Program to write numbers one to hundred in a data file notes.txt in C++ Programmin. |
//Program to write numbers one to hundred in a data file notes.txt
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
void main()
{
clrscr();
ofstream ofile("notes.txt");
for(int i=1;i<=100;i++)
ofile<<i<<" ";
ofile.close();
char a;
ifstream ifile("notes.txt");
while(!ifile.eof())
{
ifile.get(a);
cout<<a;
}
getch();
}
This C++ Program to write numbers one to hundred in a data file notes.txt in C++ Programming.
Learn More :
Data File Handling
- C++ Program To Count Number Of Alphabets In A File
- C++ File Handling Binary files - class EMPLOYEE
- C++ Initializes A String Variable And Outputs String To Disk File
- Read Content From a Text File then Count and Display the Number of Alphabets
- C++ Program to count number of blanks present in a text file
- C++ Program to count number of words in a text file
- C++ Program to Counting Words "the" in a Text File
Program to Write Numbers
One to Hundred
notes.txt
1 to 100