Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitae971855111460bc4f0ff98fdb8d6283c9c821bd (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2021-11-17 18:49:50 +0200
Committer
 GitHub <noreply@github.com>
2021-11-17 18:49:50 +0200
Files8fbfe5fef4df2e38ecd4d4e579202e2a5935e88f
Introduction_to_programming_FMI-ae971855111460bc4f0ff98fdb8d6283c9c821bd.tar
Introduction_to_programming_FMI-ae971855111460bc4f0ff98fdb8d6283c9c821bd.tar.gz
Introduction_to_programming_FMI-ae971855111460bc4f0ff98fdb8d6283c9c821bd.zip
Parentde410a99fc25a01fb9373705f406ec52597bf8e5 (diff)
Create bitwiseSimpleExamples.cpp
1 files changed, 16 insertions, 0 deletions
-rw-r--r--Sem. 07/bitwiseSimpleExamples.cpp16
diff --git a/Sem. 07/bitwiseSimpleExamples.cpp b/Sem. 07/bitwiseSimpleExamples.cpp
new file mode 100644
index 0000000..77e46b1
--- /dev/null
+++ b/Sem. 07/bitwiseSimpleExamples.cpp
@@ -0,0 +1,16 @@
+#include <iostream>
+using namespace std;
+
+bool isEven(int n)
+{
+ return !(n & 1);
+}
+
+unsigned powerOfTwo(unsigned n)
+{
+ return (1 << n);
+}
+int main()
+{
+ cout << powerOfTwo(8); // 2^8
+}