fork(12) download
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <math.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int c;
  10. int n;
  11.  
  12. scanf("%d", &n); //n = 64
  13. c = (log(n) / log(2));
  14. cout << c << endl; //OUTPUT = 5
  15.  
  16. n = 64;
  17. c = (log(n) / log(2));
  18. cout << c << endl; //OUTPUT = 6
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 2732KB
stdin
64
stdout
5
6