Mathematics
Basic Maths
GCD or HCF
int gcd(int a, int b)
{
if (a == 0)
{
return b;
}
return gcd(b % a, a);
}
int main()
{
cout << gcd(32, 24) << endl;
}Number of Digits
Number of Digits in a number ( iteratively )
Number of Digits in a number ( recursively )
Number of Digits in a number ( mathematically )
First N Prime
Factorial of a number
Last updated