Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Fibonacci recursion
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NERW using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static int Fibonacci (int x) { if(x==1||x==2) { return 1; } else { return Fibonacci(x-1)+Fibonacci(x-2); } } public static void Main(string[] args) { //Your code goes here Console.WriteLine( Fibonacci(5) ); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
walle
first index of a substring in a given string
1 to n
Armstrong
modified
Intuit // C# // Lecture_4 // Laba_#1
congtodien
Datum_CRM
String concat operation (+) vs StringBuilder
a
stackse - search stackoverflow differently
Please log in to post a comment.