Program to find all Factors of a Number using recursion | C # program to find all the factors of a number using recursion ; Recursive function to print factors of a number ; Checking if the number is less than N ; Calling the function recursively for the next number ; Driver code
using System ; class GFG { static void factors ( int n , int i ) { if ( i <= n ) { if ( n % i == 0 ) { Console . WriteLine ( i + " ▁ " ) ; } factors ( n , i + 1 ) ; } } public static void Main ( ) { int n = 16 ; factors ( n , 1 ) ; } }