Hi All,
i have two arrays .how to find the correct febanacci Series Array.
Series:
int[] A = new int[5] {0,1,1,3,5};
int[] B = new int[5] {0,1,1,2,4};
Please give me a programe to find the correct febanacci array .
am using c#..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted Apr 29, 2016, 3:41 AM EDT
Create a actual Fibonacci series and compare with your values.
using System;
class Program
{
public static int Fibonacci(int n)
{
int a = 0;
int b = 1;
for (int i = 0; i < n; i++)
{
int temp = a;
a = b;
b = temp + b;
}
return a;
}
static void Main()
{
for (int i = 0; i < 15; i++)
{
Console.WriteLine(Fibonacci(i));
}
}
}
Vivek KumarRank #272 · 9.3K reputationPosted Apr 30, 2016, 4:35 AM EDT