Lab 5.21 ***C++****
Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. Ex: If the input is: 51053212 the output is: 2 and 3 You can assume that the list of integers will have at least 2 values. To achieve the above, first read the integers into a vector. Hint: Make sure to initialize the second smallest and smallest integers properly. 407520.2641692.q×3zqy7
main.cpp Load default template... \begin{tabular}{l|l} LAB & 5.21.1: LAB: TwO smallest numbers \\ ACTIVITY & \\ 1 & #include 〈iostream> \\ 2 & #include 〈vector> \\ 3 & using namespace std; \\ 4 & \\ 5 & int main() \{ \\ 6 & \\ 7 & /* Type your code here. */ \\ 8 & \\ 9 & return 0; \\ 10 & \} \\ 11 & \end{tabular}
Lab 5.21 ***C++****
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Lab 5.21 ***C++****
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!