Advertisement
Guest User

Untitled

a guest
May 5th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _09.FibboNumbers
  8. {
  9.     class FibboNumWithForCycle
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Imput a nmber of Fibbo ledger: ");
  14.             //decimal counter = decimal.Parse(Console.ReadLine());
  15.             decimal counter = 8m;
  16.             decimal number = 1m;
  17.             decimal FirstNum = 0m;
  18.             decimal SecondNum = 0m;
  19.             decimal result = 0m;
  20.             decimal[] FibboArray = new decimal[counter];
  21.             for (int i = 0; i < counter; i++)
  22.             {
  23.                 result = FirstNum + SecondNum;
  24.                 Console.WriteLine("{0}. {1:N0}", number, result);
  25.                 FirstNum = SecondNum;
  26.                 SecondNum = result;
  27.                 number++;
  28.                 if (SecondNum == 0)
  29.                 {
  30.                     SecondNum = 1;
  31.                 }
  32.                 if (counter > i)
  33.                 {
  34.                 }
  35.             }
  36.             Console.WriteLine("Powered by Venimir Petkov");
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement