subject

Find max Traversing a vector to find the max (or min) is common. Given a vector of integers, output the maximum integer found in the vector. If the input is 43 8 26, the output is 8. Hints: • Declare a variable named maxitem to hold the max value seen so far. Update that value if you ever see a larger value. • Initialize that variable to any element's value, NOT to 0. 262108.1539616 LAB ACTIVITY 11.11.1: LAB Vectors: Find max 0/10 main. cpp Load default template... 2 #include 3 using namespace std; 4 5 int main() { 6 int numitems; 7 vector int> listItems; int curritem; 9 int i; 10 11 // Get items 12 cin >> numitems; 13 for (i = 0; i < numItems; ++i) { 14 cin >> currItem; 15 listItems. push_back(curritem); 16 } 17 18 /* Type your code here */ 19 20 return; 21 ) Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
You know the right answer?
Find max Traversing a vector to find the max (or min) is common. Given a vector of integers, output...
Questions
question
Mathematics, 29.01.2020 05:51
question
Mathematics, 29.01.2020 05:51
Questions on the website: 13722359