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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
Don't use ai i will report you answer solve it as soon as possible with proper explanation
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
Transcribed Image Text: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
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr