text: Find all factors of a natural number | Set 1 | C # implementation of Naive method to print all divisors ; method to print the divisors ; Driver method
code: using System ; class GFG { static void printDivisors ( int n ) { for ( int i = 1 ; i <= n ; i ++ ) if ( n % i == 0 ) Console . Write ( i + " ▁ " ) ; } public static void Main ( ) { Console . Write ( " The ▁ divisors ▁ of " , " ▁ 100 ▁ are : ▁ " ) ; printDivisors ( 100 ) ; ; } }