...

/

Solution Review: Multiplication Table

Solution Review: Multiplication Table

This lesson contains the solution review for the exercise on Multiplication Table.

We'll cover the following...

Here is the code to the challenge in the previous lesson:

Press + to interact
package main
import ( "fmt"
"sync"
"time")
func printTable(n int, wg *sync.WaitGroup) {
for i := 1; i <= 12; i++ {
fmt.Printf("%d x %d = %d\n", i, n, n*i)
time.Sleep(50 * time.Millisecond)
}
wg.Done()
}
func main() {
var wg sync.WaitGroup
for number := 2; number <= 12; number++ {
wg.Add(1)
go printTable(number,&wg)
}
wg.Wait()
}

So we added ...

Access this course and 1400+ top-rated courses and projects.