diff options
author | zedarider <ymherklotz@gmail.com> | 2016-02-18 11:37:45 +0000 |
---|---|---|
committer | zedarider <ymherklotz@gmail.com> | 2016-02-18 11:37:45 +0000 |
commit | af98ee7ff28cff97f5f29a5d9e65f9153531b0ee (patch) | |
tree | 86bfc53a0bc04512ac2936ee067a2b43e901e688 /EvenOddCom1ex.cpp | |
download | imperial_2015-af98ee7ff28cff97f5f29a5d9e65f9153531b0ee.tar.gz imperial_2015-af98ee7ff28cff97f5f29a5d9e65f9153531b0ee.zip |
Imperial C++ Directory
These are all the projects I’ve been working on at university.
Diffstat (limited to 'EvenOddCom1ex.cpp')
-rw-r--r-- | EvenOddCom1ex.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/EvenOddCom1ex.cpp b/EvenOddCom1ex.cpp new file mode 100644 index 0000000..aa3410e --- /dev/null +++ b/EvenOddCom1ex.cpp @@ -0,0 +1,18 @@ +#include <iostream> +#include <cmath> + +using namespace std; + +int main() { + int num; + cout << "Please enter a number: "; + cin >> num; + if(num % 2 == 0) { + cout << "even" << endl; + } + else { + cout << "odd" << endl; + } + + return 0; +}
\ No newline at end of file |