Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you help explain output of this C++ program const int a [ ] { 7, -12, 5, 11, -9, 25, 1, 7, 15, 0,

can you help explain output of this C++ program

const int a [ ] { 7, -12, 5, 11, -9, 25, 1, 7, 15, 0, 99, 7, };

template void print ( const T& x) ( cout << x << ' '; )

int main ( )

{

deque d; int u = 10, v = 20;

copy ( begin (a), end (a), front_inserter (d) );

for_each (d.cbegin ( ), d.cend ( ), print );

cout << endl;

cout << *find_if (d.cbegin ( ), d.cend ( ),

[ = ] (const int& x) {return x > u && x < v; } )

<< endl

d.erase ( remove (d.begin ( ), d.end ( ), 7 ), d.end

( ) );

copy ( d.cbegin ( ), d.cend ( ) -1, ostream_iterator

(cout, ":" ) );

cout << *( d.cend ( ) - 1) << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

Explain Industrial market segment.

Answered: 1 week ago

Question

Explain the market segmentation.

Answered: 1 week ago