CSharp examples for System:Math Number
get Number Of Divisors
using System;/*from w w w. j a v a 2 s . c o m*/ public class Main{ public static int getNumberOfDivisors(int n) { var numberOfDivisors = 0; var current = 1; var currentThreshold = n; while (current < currentThreshold) { if (n % current == 0) { currentThreshold = n / current; numberOfDivisors += 2; } current++; } return numberOfDivisors; } }