Guys , please help me about my assignment in Programming. I need to make a code for this output of Fibonacci Seried of #.
---Fibonacci Series of #--
Enter the 1st series:
Enter the 2nd series:
Enter the # of series to display:
The nth series is:
Thank you for your help.
Loading
VulpesPosted Nov 12, 2014, 6:44 AM
Joginder BangerPosted Nov 12, 2014, 6:42 AM
This program run in console based application.
class Program {
public static int Fibonacci(int n)
{ int a = 0;
int b = 1;
// In N steps compute Fibonacci sequence iteratively.
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));
}
}
}