#include <iostream> using namespace std; int main() { int i=2; cout << i << ++i << endl; cout << !(i==3) << endl; if (i%2) cout << even << endl; else cout << odd << endl; } code example

Example: #include using namespace std; int main() { int n; cout << "Enter an integer: "; cin >> n; if ( n % 2 == 0) cout << n << " is even."; else cout << n << " is odd."; return 0; }

#include <iostream>
using namespace std;

int main()
{
    int n;

    cout << "Enter an integer: ";
    cin >> n;

    if ( n % 2 == 0)
        cout << n << " is even.";
    else
        cout << n << " is odd.";

    return 0;
}

Tags:

Misc Example