Page 1 of 1

Lab 5.21 ***C++****

Posted: Thu Jul 14, 2022 2:06 pm
by answerhappygod
Lab 5.21 ***C++****
Lab 5 21 C 1
Lab 5 21 C 1 (38.65 KiB) Viewed 14 times
Lab 5 21 C 2
Lab 5 21 C 2 (25.3 KiB) Viewed 14 times
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: 5​10​5​3​21​2​ 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}