Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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();
- }
Advertisement
Add Comment
Please, Sign In to add comment