text: Sum of divisors of factorial of a number | C # program to find sum of proper divisor of factorial of a number ; function to calculate factorial ; function to calculate sum of divisor ; Returns sum of divisors of n ! ; Driver Code
code: using System ; class Division { static int fac ( int n ) { if ( n == 0 ) return 1 ; return n * fac ( n - 1 ) ; } static int div ( int x ) { int ans = 0 ; for ( int i = 1 ; i <= x ; i ++ ) if ( x % i == 0 ) ans += i ; return ans ; } static int sumFactDiv ( int n ) { return div ( fac ( n ) ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( sumFactDiv ( n ) ) ; } }