Advertisement
Guest User

Even Powers of 2

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