Vidyalelo
C++ Programming · Q632

C++ miscellaneous

Programming · C++ Programming · question 632

Q632

What will be the output of the following C++ code? #include #include #include using namespace std; int main() vector v(10, 2); if (all_of(v.cbegin(), v.cend(), [](int i) return i % 2 == 0; )) cout << "All numbers are even "; else cout << "All numbers are not even "; return 0;

A.
All numbers are even
Answer
B.
All numbers are not even
C.
Error
D.
Segmentation fault

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board