text: An efficient way to check whether n | A simple C # program to check if n - th Fibonacci number is multiple of 10. ; Returns true if n - th Fibonacci number is multiple of 10. ; main function
code: using System ; class GFG { static int fibonacci ( int n ) { int a = 0 ; int b = 1 ; int c = 0 ; if ( n <= 1 ) return n ; for ( int i = 2 ; i <= n ; i ++ ) { c = a + b ; a = b ; b = c ; } return c ; } static bool isMultipleOf10 ( int n ) { int f = fibonacci ( 30 ) ; return ( f % 10 == 0 ) ; } public static void Main ( ) { int n = 30 ; if ( isMultipleOf10 ( n ) ) Console . Write ( " Yes " ) ; else Console . Write ( " No " ) ; } }