Complete the code to print numbers from 1 to 3 using a loop.
for i := 1; i <= [1]; i++ { fmt.Println(i) }
The loop should run from 1 to 3, so the condition is i <= 3.
Complete the code to print a 3x3 grid of stars using nested loops.
for i := 0; i < 3; i++ { for j := 0; j < [1]; j++ { fmt.Print("*") } fmt.Println() }
Both loops should run 3 times to create a 3x3 grid.
Fix the error in the nested loops to print numbers 1 to 3 in each row.
for i := 1; i <= 3; i++ { for j := 1; j <= [1]; j++ { fmt.Print(j, " ") } fmt.Println() }
The inner loop should run from 1 to 3 to print numbers 1, 2, 3 in each row.
Fill both blanks to create a multiplication table from 1 to 3.
for i := 1; i <= [1]; i++ { for j := 1; j <= [2]; j++ { fmt.Printf("%d ", i*j) } fmt.Println() }
Both loops should run from 1 to 3 to create a 3x3 multiplication table.
Fill all three blanks to print a right triangle of stars with 3 rows.
for i := 1; i <= [1]; i++ { for j := 1; j <= [2]; j++ { if j <= [3] { fmt.Print("*") } } fmt.Println() }
j instead of i in the if condition.The outer and inner loops run 3 times. The if condition prints stars up to the current row number i.
