Find the last two digits of Factorial of a given Number | C # implementation to find last two digits factorial of a given number ; Function to print the last two digits of N ! ; For N >= 10 , N ! % 100 will always be 0 ; Calculating N ! % 100 ; Driver code
using System ; class GFG { static void lastTwoDigits ( double N ) { if ( N >= 10 ) { Console . Write ( "00" ) ; return ; } double fac = 1 ; for ( int i = 1 ; i <= N ; i ++ ) fac = ( fac * i ) % 100 ; Console . Write ( fac ) ; } public static void Main ( ) { int N = 7 ; lastTwoDigits ( N ) ; } }