Program is to store first n natural no in a file:
Write a program to store first n natural no in a file
void main()
{
fstream file;
file.open("student.dat",ios::in|ios::out|ios::app);
int n;
cout<<" enter record to be modified ";
cin>>n;
file.seekg((n-1)*sizeof());
file.read((char *)& ,sizeif());
file.write((char *)& ,sizeof());
file.close();
}