Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 04 / example09 .cpp
diff options
context:
space:
mode:
Commit2af7aac08e3bae3ed6e99fe04c32d39acb4bb129 (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2021-11-02 14:34:38 +0200
Committer
 GitHub <noreply@github.com>
2021-11-02 14:34:38 +0200
Files88ece868d972d1e44e44481c7e30ba5c17d684df /Sem. 04/example09 .cpp
Introduction_to_programming_FMI-2af7aac08e3bae3ed6e99fe04c32d39acb4bb129.tar
Introduction_to_programming_FMI-2af7aac08e3bae3ed6e99fe04c32d39acb4bb129.tar.gz
Introduction_to_programming_FMI-2af7aac08e3bae3ed6e99fe04c32d39acb4bb129.zip
Parent7b48d82f74cfa2a8820cad4c50ca7a916458850a (diff)
Add files via upload
1 files changed, 21 insertions, 0 deletions
-rw-r--r--Sem. 04/example09 .cpp21
diff --git a/Sem. 04/example09 .cpp b/Sem. 04/example09 .cpp
new file mode 100644
index 0000000..f7f072b
--- /dev/null
+++ b/Sem. 04/example09 .cpp
@@ -0,0 +1,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;
+} \ No newline at end of file