Question: Write a c + + program that performs file operation to store and retrieve data. The program should: Prompt the user to enter a list

Write a c++ program that performs file operation to store and retrieve data. The program should:
Prompt the user to enter a list of integers, one per line, and save these integers to a file named data.txt.
read integer from the data txt and dispaly them on screen
Example Output:
Enter integers (enter -1 to stop):
10
20
30
-1
contents of data.txt:
10
20
30

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 Programming Questions!