Advertisement
Spocoman

04. Even Powers of 2

Sep 20th, 2024
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.20 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "math"
  6. )
  7.  
  8. func main() {
  9.     var number int
  10.     fmt.Scanln(&number)
  11.    
  12.     for i := 0; i <= number; i += 2 {
  13.         fmt.Println(math.Pow(2, float64(i)))
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement