Question
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
int main ( )
{
deque
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 << *( d.cend ( ) - 1) << endl;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started