#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
int main()
 {
   ofstream outFile ;
   int i, day, sales ;
   outFile.open("sales.dat", ios::out|ios::binary);
   if (!outFile.is_open()) {
     cerr << "Could not create file." << endl;
       exit(1);
}
   cout<<"enter number of days : ";
   cin>>day;
   for (i=0; i<day; i++) {
       cout<<"enter daily sales (day): "<< i+1<<" = ";
       cin>>sales ;
       outFile.write((char *)(&sales), sizeof(int));
   }
   outFile.close();
   return 0;
}
