Created
October 19, 2022 22:12
-
-
Save virtuosonic/76cd3274f043b0f3fa73c2d369c65539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
bool isEven(int n ){ | |
return !(n % 2); | |
} | |
void printEvenness(int x){ | |
cout << x << " is even: " << std::boolalpha << isEven(x) << endl; | |
} | |
int main() | |
{ | |
auto n1 = 5; | |
vector<int> ints { 5,3,4,62,7,12,35,44,88,1,9,2} ; | |
for_each(ints.begin(), ints.end(), printEvenness); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment