package main
import "fmt"
func main() {
var s int64 = Fibonacci(7)
fmt.Println(s)
}
func Fibonacci(num int64) (int64) {
if num == 1 || num == 2 {
return 1
} else {
return Fibonacci(num-2) + Fibonacci(num-1)
}
}
2024-03-02 10:46:58
package main
import "fmt"
func main() {
var s int64 = Fibonacci(7)
fmt.Println(s)
}
func Fibonacci(num int64) (int64) {
if num == 1 || num == 2 {
return 1
} else {
return Fibonacci(num-2) + Fibonacci(num-1)
}
}