Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 04 / example09 .cpp
blob: f7f072b15b16a5694e6817e814e199f3d0c9f353 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;

unsigned int log(unsigned int n, unsigned int k)
{
	int count = 0;

	while (n >= k)
	{
		n /= k;
		count++;
	}

	return count;
}


int main()
{
	cout << log(4, 10) << endl;
}