Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 04 / example09 .cpp
diff options
context:
space:
mode:
Commitae848f59af8762134c090563ce86bf114b295352 (patch)
Author
 Justsvetoslavov <justsvetoslavov@gmail.com>
2021-11-02 16:23:54 +0200
Committer
 Justsvetoslavov <justsvetoslavov@gmail.com>
2021-11-02 16:23:54 +0200
Filesf9f86dfa04bf9b3afcb39aaf2bd0a50147b5ed37 /Sem. 04/example09 .cpp
Introduction_to_programming_FMI-ae848f59af8762134c090563ce86bf114b295352.tar
Introduction_to_programming_FMI-ae848f59af8762134c090563ce86bf114b295352.tar.gz
Introduction_to_programming_FMI-ae848f59af8762134c090563ce86bf114b295352.zip
Parente55e9fb058a046f6f1e08da521660a8d98b1d5db (diff)
Parenta0d9a533e6e4f6b5b06fff9268e9bf6233ef3eef (diff)
Merge branch 'main' of https://github.com/Angeld55/Introduction_to_programming_FMI
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