Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Programming introduction / Solutions Sem. 03 / 05. Power_Of_Two.cpp
blob: 0a5c88f71700aa7b2c8aabb1abdc9c9eb8ebeff0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;

int main()
{
	int n;
	cin >> n;

	while (n % 2 == 0 && n > 1)
		n /= 2;

	cout << ((n == 1) ? "true" : "false") << endl;
}