Question: #include #include #include using namespace std; int main(){ string myfile; //string class cout < > myfile; //type in ofstream outputfile; outputfile.open(file.txt); //srand(time(NULL)); for ( int

#include

#include

#include

using namespace std;

int main(){

string myfile; //string class

cout <<"Enter file name: "; // output

cin >> myfile; //type in

ofstream outputfile;

outputfile.open("file.txt");

//srand(time(NULL));

for (int i=0; i<1000;i++ ){ //random numbers

outputfile<<(1+rand()% 1000)<

}

cout << "Ramdom number: "<< myfile <

outputfile.close(); //close the file

return 0;

}

do this code to the read file .

C++ - Read from a file.

(Function Organized Code is Ok)

Read the [1000 random integers] for .txt File into a file buffer multiple each output by 10 and output to the console.

Implement a file buffer.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!