Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 07 / bitwiseSimpleExamples.cpp
blob: 77e46b1880e36339fe06726616d8de76d8bf51a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}