Exercise: Multiplication Table
Test your skills by printing out a multiplication table using goroutines and waitgroups!
In this exercise, you have been provided with a code which prints out the multiplication table from 1
to 12
. It creates goroutines in a for-loop which also run another for-loop for each number from 1
to 12
. However, nothing is printed out as the main routine exits before the goroutines are able to print.
You are required to solve this problem using WaitGroup
from the sync
package and output all the tables on to the console.
Get hands-on with 1400+ tech skills courses.