diff options
Added Solutions
1 files changed, 23 insertions, 0 deletions
| -rw-r--r-- | pract_SI/Pract. 04/Solutions/task2 - example1.cpp | 23 |
diff --git a/pract_SI/Pract. 04/Solutions/task2 - example1.cpp b/pract_SI/Pract. 04/Solutions/task2 - example1.cpp new file mode 100644 index 0000000..309e68d --- /dev/null +++ b/pract_SI/Pract. 04/Solutions/task2 - example1.cpp @@ -0,0 +1,23 @@ +#include <iostream> +using namespace std; +bool isZero(const int number) +{ + return (number == 0); +} + +bool isEven(const int number) +{ + if (isZero(number)) + { + return false; + } + return !(number % 2); +} + +int main() +{ + int n; + cin >> n; + cout << boolalpha << isEven(n) << endl; + return 0; +}
\ No newline at end of file |
