March 2019
Intermediate to advanced
336 pages
9h 9m
English
The main method in the following code snippet shows how the Fibonacci sequence is calculated:
// main methodfunc main() { var i int for i = 0; i <= 9; i++ { fmt.Print(strconv.Itoa(Series(i)) + " ") } fmt.Println("") for i = 0; i <= 9; i++ { fmt.Print(strconv.Itoa(FibonacciNumber(i)) + " ") } fmt.Println("")}
Run the following command to execute the fibonacci_sequence.go file:
go run fibonacci_sequence.go
The output is as follows:

The next section talks about the look-and-say data structure.
Read now
Unlock full access