sdsdfdu

Fibonacci Sequence

May 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1. using System.IO;
  2. using System;
  3. class Fibonacci
  4. {
  5.     static void Main (string[]args)
  6.     {
  7.         int i = 1;
  8.         int temp = 0;
  9.         int temp1 = 0;
  10.         for(int a = 0; a < 10 /*arbitrary number*/; a++)
  11.         {
  12.             Console.WriteLine(i);
  13.             temp1 = temp;
  14.             temp = i;
  15.             i = temp + temp1;
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment