Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ KwehDev
shravan20
Avatar
bettman-latin
alisa-odo
33 changes: 33 additions & 0 deletions fibonacci_series/Chef/Chef_fibonacci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Ice Cream a la Fibonacci.

This delicious recipe yields 1 serving of cinnamon ice cream if the serving is big enough.
Please make sure not to add the mashed banana all at once but in multiple steps (as described). This will improve the consistency of the ice cream.
Personal Note by the chef: I recommend executing this recipe at https://tio.run/#chef if you don't have a Chef interpreter at hand. An input of n will give you the (n+2)th Fibonacci number.

Ingredients.
500 g ice cream
1 cup mashed banana
0 cups salt
150 g suggar
3 pinches cinnamon

Cooking time: 25 minutes.

Method.
Take ice cream from refrigerator.
Heat the ice cream.
Put mashed banana into mixing bowl.
Fold suggar into mixing bowl.
Put cinnamon into mixing bowl. Stir for 7 minute.
Put mashed banana into mixing bowl.
Add salt to mixing bowl.
Fold mashed banana into mixing bowl.
Put suggar into mixing bowl.
Fold salt into mixing bowl.
Reheat the ice cream until heated.
Put ice cream into mixing bowl. Stir for 15 minutes.
Put mashed banana into 2nd mixing bowl.
Pour contents of the 2nd mixing bowl into the 1st baking dish.
Refrigerate the ice cream. Cool the ice cream until refrigerated.

Serves 1.
29 changes: 29 additions & 0 deletions fibonacci_series/Rust/rust_fibonacci_recursive.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use std::io;

fn fib(x: u128)->u128{
if x <=2{
1
}
else{
fib(x-1)+fib(x-2)
}
}

// copied main() from https://github.com/fharookshaik/fibonacci-series/blob/main/fibonacci_series/Rust/rust_fibonacci.rs
fn main() {
println!("How many fibonacci terms should be printed?");

let mut n: String = String::new();
io::stdin()
.read_line(&mut n)
.expect("Failed to read input");

let n: u128 = n
.trim()
.parse()
.expect("Please enter a valid number");

for i in 1..(n+1) {
println!("{}", fib(i));
}
}