main.cpp x //Given a list of numbers find the largest and the smallest values of the list and display them. 1 2 3 #include 4 #include #include auto largest(std::vector list) { 7 8 10 } 11 auto smallest(std::vector list) { 12 13 14 15 } 16 17 int main() { 18 19 std::vector list({1,4,5,9,6,21,14,15,8,11}); 20 21 }

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 13PE
icon
Related questions
Question

This.

main.cpp x
//Given a list of numbers find the largest and the smallest values of
the list and display them.
1
2
#include <iostream>
4
#include <vector>
#include <string>
6
auto largest(std::vector<int> list)
{
7
10
}
11
auto smallest(std::vector<int> list)
{
12
13
14
15
}
16
17
int main() {
18
19
std::vector<int> list({1,4,5,9,6,21,14,15,8,11});
20
21
}
Transcribed Image Text:main.cpp x //Given a list of numbers find the largest and the smallest values of the list and display them. 1 2 #include <iostream> 4 #include <vector> #include <string> 6 auto largest(std::vector<int> list) { 7 10 } 11 auto smallest(std::vector<int> list) { 12 13 14 15 } 16 17 int main() { 18 19 std::vector<int> list({1,4,5,9,6,21,14,15,8,11}); 20 21 }
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Perception
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage