Advertisement
Spocoman

04. Even Powers of 2

Sep 6th, 2023
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int number;
  8.     cin >> number;
  9.  
  10.     for (int i = 0; i <= number; i += 2) {
  11.         cout << pow(2, i) << endl;
  12.     }
  13.  
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement