Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8.     int  n, i = 0;
  9.     double f;
  10.    
  11.     cout << "n = ";
  12.     cin >> n;
  13.    
  14.     do
  15.     {
  16.        ++i;
  17.        f = pow(2.0, i);
  18.    
  19.         } while (f < n);
  20.    
  21.     cout << i;
  22.    
  23.     getch ();
  24.     return 0;
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement