Question: C++ 1. 2.Given a set of data, output the middle item (if even number of items, output the two middle items). If the input is
C++
1.
2.Given a set of data, output the middle item (if even number of items, output the two middle items). If the input is 5 7 9 11 13 -1 (a negative indicates end), the output is 9. If the input is 5 7 9 11 -1, the output is 7 9
3.
Write a program the reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a space, even the last one. If the input is 5 2 4 68 10, the output is: 10 8 6 4 2 To achieve the above, first read the integers into a vector. Then output the vector in reverse. LAB 8.11.1: C LAB: output numbers in reverse ACTIVITY 0 10 main.cpp Load default template... 1 #include Kiostream> 2 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
