Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to find even and odd numbers in c++

#include<bits/stdc++.h>
using namespace std;

int main ()

{
    int x;
    cin >> x;
    if (x % 2 == 0) {
        cout << x << " " <<"is even number" endl;
    } else {
        cout << x << " " << "is odd number" endl;
        }

    return 0;
}
 
PREVIOUS NEXT
Tagged: #find #odd #numbers
ADD COMMENT
Topic
Name
4+3 =