Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <conio.h>
- using namespace std;
- int main ()
- {
- int n, i = 0;
- double f;
- cout << "n = ";
- cin >> n;
- do
- {
- ++i;
- f = pow(2.0, i);
- } while (f < n);
- cout << i;
- getch ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement