title: write a logarithmic function in c++
body: <p>I want to write a function to calculate the logarithm of a number to any base in c++<br>
  this function should be able to calculate the logarithm of <strong>any numbers in any base</strong></p>
  
  <pre><code>#include &lt;bits/stdc++.h&gt;
  
  using namespace std;
  
  int main()
  
  {
      int number,base;
      int i=0;//this is the counter
      double value=0; //the value of the power 
      cout&lt;&lt;"enter the number : "&lt;&lt;endl;
      cin&gt;&gt;number;
      cout&lt;&lt;"enter the base : "&lt;&lt;endl;
      cin&gt;&gt;base;
      while (value&lt;number){//if the value of the power &lt;the number the loop will be continue 
           value=pow(base,i);
           if (value==number) //this if statment to check if the result is correct or not
           {
              break;
           }i+=1;
   }cout&lt;&lt;"the result is :  "&lt;&lt;i&lt;&lt;endl;//print the result on the screen
  
   return 0;
  }
  </code></pre>