rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Solution 369: Combinations

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Solution 369: Combinations

#include <iostream>
#include <iomanip>
using namespace std;
long double factorial (long double n)
{
    long double r = 1;
    for (long double i = 2; i <= n; i++)
    {
        r *= i;
    }
    return r;
}
int main ()
{
    long double m, n;
    while (cin >> m >> n&&m!=0&&n!=0)
    {
        long double r = (factorial(m))/(factorial(m-n)*factorial(n));
        cout << m << " things taken " << n << " at a time is " << fixed << setprecision(0) << r << " exactly." << endl;
    }
}