Find the previous fibonacci number | C # implementation of the approach ; Function to return the previous fibonacci number ; Driver code
using System ; class GFG { static int previousFibonacci ( int n ) { double a = n / ( ( 1 + Math . Sqrt ( 5 ) ) / 2.0 ) ; return ( int ) Math . Round ( a ) ; } public static void Main ( ) { int n = 8 ; Console . Write ( previousFibonacci ( n ) ) ; } }