Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, k, N;
- cin >> N;
- i = 1;
- cout << 1 << " ";
- k = 0;
- while (k <= N)
- {
- k = 2 * 2 * i;
- cout << k << " ";
- i = i * 2;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement