ExamVeda
Login
Home
C plus plus miscellaneous
?

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

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.