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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post by answerhappygod »

Lab 5.21 ***C++****
Lab 5 21 C 1
Lab 5 21 C 1 (38.65 KiB) Viewed 13 times
Lab 5 21 C 2
Lab 5 21 C 2 (25.3 KiB) Viewed 13 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}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply