1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ivan
3 years ago
13

Write a fragment of code that opens a file named numbers.txt, reads in pairs of number until end of file and sends the smaller o

f the two to a file named min.txt and the larger of the two to a file named max.txt (one number per line). You can assume there are no ties. (basic file input/output)
Computers and Technology
1 answer:
jok3333 [9.3K]3 years ago
8 0

Answer:

See explaination for code

Explanation:

int x, y;

ifstream numbers;

numbers.open ("numbers.txt");

ofstream min;

min.open ("min.txt");

ofstream max;

max.open ("max.txt");

while(numbers>>x>>y )

{

if(x>y)

{

max<<x<<endl;

min<<y<<endl;

}

else

{

max<<y<<endl;

min<<x<<endl;

}

}

numbers.close;

min.close;

max.close;

You might be interested in
_____ is the operation of setting a variable to a value.
Helen [10]

Answer:

Assignment is the operation of a variable to a value

3 0
3 years ago
a problem exists when the current condition differs from a desired condition. This idea defines which step in problem-solving?
zhannawk [14.2K]

In algorithm the idea defines a decision box

5 0
3 years ago
Read 2 more answers
To rearrange the data on your hard disk so your computer can run more efficiently, you use ____.
Ratling [72]
A disk optimization program, but they're probably looking for defragmenting program.
5 0
3 years ago
A curb of this color means you may stop only to pick up or drop offs passengers or male
Delicious77 [7]
I believe it is a white curb!
7 0
4 years ago
____ is the study of how computers can potentially improve without human programming.
Advocard [28]

Answer:

Machine Learning and/or Artificial Intelligence (AI)

5 0
1 year ago
Other questions:
  • Laura is photographing her son’s baseball game. What ISO setting should she use?
    11·1 answer
  • A name given to a spot in memory is called:
    5·1 answer
  • Standards for all managers ethical responsibilities are covered in a company's
    7·2 answers
  • Antivirus software installed to scan and monitor malware activities on a server or workstation would be identified as a ________
    8·1 answer
  • Kiaan wants to give people who attend his presentation a printed copy of the slides. Instead of printing one slide on each piece
    11·1 answer
  • Cliff just started working with a client who has a very disorganized AdWords account. What’s an effective way for him to begin r
    15·1 answer
  • Here is the list of problems to choose from:
    11·1 answer
  • Check examples of a good work ethic. *
    6·1 answer
  • What should be done with statements or sections which are unclear?
    12·2 answers
  • Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the ou
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!