Hi Friends, Here I have Written Fibbonacci series code in C sharp.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Fibbonacies
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i <= 10;i++ )
Console.WriteLine(Fibbonanci(i));
Console.Read();
}
static int Fibbonanci(int x)
{
if (x < 1)
return 1;
return Fibbonanci(x - 1) + Fibbonanci(x-2);
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.