JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
Gems Demo
Gems Demo
Basic Usage
Code Generation
OCR
More
Share
Explore
Code Generation
This page utilizes the
Gems
pack for code generation and the
Judge0
Pack for code execution.
Generate Code
Programming Language:
Blank
Run Code
Code
Result
Code
Result
1
fn main() { let n = 10; for i in 0..n { println!("{}", fib(i)); } }
fn fib(n: u32) -> u32 { if n == 0 { return 0; } else if n == 1 { return 1; } else { return fib(n - 1) + fib(n - 2); } }
0 1 1 2 3 5 8 13 21 34
There are no rows in this table
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.