Skip to content

Instantly share code, notes, and snippets.

@ehrktia
Created July 31, 2019 22:18
Show Gist options
  • Select an option

  • Save ehrktia/92d6abd3242531e457ca68c4d6627ba9 to your computer and use it in GitHub Desktop.

Select an option

Save ehrktia/92d6abd3242531e457ca68c4d6627ba9 to your computer and use it in GitHub Desktop.
multiply using recursion
package main
import "fmt"
func col(i int) {
fmt.Printf(" %d", i)
row(i, 2)
fmt.Println("")
i++
if i <= 12 {
col(i)
}
}
func row(i, j int) {
if i <= 12 {
fmt.Printf(" %d", i*j)
}
j++
if j <= 12 {
row(i, j)
}
}
func main() {
col(1)
}
@ehrktia

ehrktia commented Jul 31, 2019

Copy link
Copy Markdown
Author

multiply using recursion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment