Test All Gadget, Z3X BOX Samsung, Miracle Box, Smart Phone Flash Tool, Stock ROMs, Android Tool, apps, Data Plans Internet

Selasa, 24 Desember 2013

C# Program to Print Fibonacci series

C# Program to Print Fibonacci series - discussing about technology is my hobby, with media blogs Test All Gadget we can share the knowledge of technology that continues to grow with various ways of use that is intended to simplify your life, now we will discuss first about that in your search that is C# Program to Print Fibonacci series please refer to our explanation because we will try to make a complete article for you.

Articles : C# Program to Print Fibonacci series
full Link : C# Program to Print Fibonacci series
Article Csharp, Article programming, Article programs,

You can also see our article on:


C# Program to Print Fibonacci series

C# Program to Print Fibonacci series

Program Statement:
Write a program which prints the Fibonacci series using loop.
1 1 2 3 5 8 13 21 34 …

Solution:
 public class _fib
{
int f = 0, s = 1, n, fib = 0;
public void _show()
{
Console.WriteLine("\n\t\tPrint fibonacci series 0 1 1 2 3 5 8 13 ...\n\n");
Console.Write("\n\t\tEnter range of terms of fibonacci series : ");
n = Convert.ToInt32(Console.ReadLine());
Console.Write("\n\t\tFirst {0} terms are : ", n);
for (int x = 0; x < n; x++)
{
if (x <= 1)
{ fib = x; }
else
{
fib = f + s;
f = s;
s = fib;
}
Console.Write("{0} ", fib);
}
Console.WriteLine("\n");
}
}




enough already articles C# Program to Print Fibonacci series

hopefully the information C# Program to Print Fibonacci series that we submit on this blog can be useful for your life and all the people who visit this blog.

you just finished reading the article with the title C# Program to Print Fibonacci series if you intend to bookmark or shre please use the link https://testallforone.blogspot.com/2013/12/c-program-to-print-fibonacci-series.html and do not visit other pages on this blog because it still sangant a lot of information about gadgets from the old to the latest.

Tag : , , ,
Share on Facebook
Share on Twitter
Share on Google+

Related : C# Program to Print Fibonacci series

0 komentar:

Posting Komentar