Consider two input files (with physical names “infile1.txt” and “infile2.txt”) w
ID: 3641921 • Letter: C
Question
Consider two input files (with physical names “infile1.txt” and “infile2.txt”) where each input file contain in each line an integer value and the values in a file are already sorted in ascending order. Write a program that reads the input files and merges their content into an output file (with physical name “outfile.txt”) such that the values in the output file are also sorted in ascending order. Your program should not crash in any of the files is empty.For example, if the first input file “infile1.txt” contains values:
1
4
6
And, if the second input file “infile2.txt” contains values:
2
8
9
Then the output file “outfile.txt” should contain:
1
2
4
6
8
9