This program is using filing concept, and will make a file called notes.txt and generate numbers from 1 to 100 using for loop.
#include<iostream>
#include<fstream>
using namespace std;
main()
{
ofstream myFile;
myFile.open("Notes.txt", ios::app);
for(int i=1; i<=100; i++)
{
myFile<<i<<" ";
}
myFile.close();
system("pause");
}
#include<iostream>
#include<fstream>
using namespace std;
main()
{
ofstream myFile;
myFile.open("Notes.txt", ios::app);
for(int i=1; i<=100; i++)
{
myFile<<i<<" ";
}
myFile.close();
system("pause");
}
No comments:
Post a Comment