Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. static int FibonacciIteraviteOneLoop(int num)
  2.         {
  3.             System.Numerics.BigInteger current = 1;
  4.             System.Numerics.BigInteger previous = 0;
  5.  
  6.             int i = 1;
  7.  
  8.             while ((current + previous) % num != 0)
  9.             {
  10.                 System.Numerics.BigInteger temp = current + previous;
  11.                 previous = current;
  12.                 current = temp;
  13.                 i++;
  14.             }
  15.  
  16.             return i + 1;
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement