In a loop, fill an array for up to 50 even numbers and a set for up to 50 odd numbers. Use the merge() algorithm to merge these containers into a vector. Display the vector contents to show that all went well. (In C++ language)
1. In a loop, fill an array for up to 50 even numbers and a set for up to 50 odd numbers. Use the merge()
2. Write a program that copies a source file of integers to a destination file, using stream iterators. The user should supply both source and destination filenames to the program. You can use a while loop approach and a list container with integer data type. Within the loop, read each integer value from the input iterator and add the value to the list container by using push_back() function, then increment the input iterator.
Finally, use an output iterator to write the list to the destination file. (In C++ language)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images