C++ Programming Code Examples C++ > If Else and Switch Case Code Examples If-Else Statement - check even or odd If-Else Statement - check even or odd for(int x = 0; x <= 100; ++x) { if (x % 2 == 0) cout << x << " is even" << endl; else cout << x << " is odd" << endl; }