Fibonacci in Odin

Published on 30 October 2025 (Updated: 30 October 2025)

Welcome to the Fibonacci in Odin page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

package main

import "core:fmt"
import "core:strconv"
import "core:os"

main :: proc() {
    if len(os.args) != 2 {
        usage()
        return
    }
    input, check := strconv.parse_int(os.args[1], 10)
    if !check {
        usage()
        return
    }

    use1 := 0
    use2 := 1
    use3 := 0
    for i:=1 ; i <= input; i += 1 {
        use3 = use1 + use2
        use1 = use2
        use2 = use3
        fmt.print(i)
        fmt.print(": ")
        fmt.println(use1)
    }
}

usage :: proc() { 
    fmt.println("Usage: please input the count of fibonacci numbers to output")
}

Fibonacci in Odin was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.