How to calculate base-10 logarithm in C++

1 Answer

0 votes
#include <bits/stdc++.h> 
  
using namespace std; 
  
int main()
{
    double d = 5;
    
    cout << log10(d) << endl; 

    return 0;
}
  
  
  
/*
run:
  
0.69897

*/

 



answered Feb 8, 2020 by avibootz

Related questions

1 answer 307 views
1 answer 178 views
2 answers 347 views
3 answers 365 views
...