Go Program to print 1 to 100 without loop

We declared a recursive function in this Go program to print numbers from 1 to 100 without using for loop. Here, printNumbers(num + 1) calls the printNumbers() function recursively. package main import “fmt” func printNumbers(num int) { if num <= 100 { fmt.Print(num, “\t”) printNumbers(num + 1) } } func main() { number := 1 … Read more