title: How to convert an integer to binary form in Go and vice versa
body: <p>How do i convert an Integer to binary form?</p>
  
  <p>I'm currently working on a program that takes an integer and converts it to binary form.
  It should also take the binary number and reverse it and convert it back to an integer and print it out.</p>
  
  <p>i.e. </p>
  
  <blockquote>
    <p><code>12 -> 1100 -> 0011 -> 3</code></p>
  </blockquote>
  
  <p>So the program should basically:
  Input: 12
  Output: 3</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "strconv"
  )
  
  var j int
  
  func main() {
      fmt.Scan(&amp;j)
      n := int64(j)
      y := strconv.FormatInt(n, 2)
      fmt.Println(y)
      reverse(y)
  }
  
  func reverse(y string) {
  }
  </code></pre>