Find the next fibonacci number | C # implementation of the approach ; Function to return the next fibonacci number ; Driver code
using System ; class GFG { static long nextFibonacci ( int n ) { double a = n * ( 1 + Math . Sqrt ( 5 ) ) / 2.0 ; return ( long ) Math . Round ( a ) ; } public static void Main ( String [ ] args ) { int n = 5 ; Console . WriteLine ( nextFibonacci ( n ) ) ; } }