# Python Program - Find ncR and nPr

import math;
print("Enter 'x' for exit.");
nval = input("Enter value of n: ");
if nval == 'x':
    exit();
else:
    rval = input("Enter value of r: ");
    n = int(nval);
    r = int(rval);
    npr = math.factorial(n)/math.factorial(n-r);
    ncr = npr/math.factorial(r);
    print("ncR =",ncr);
    print("nPr =",npr);

e39c98eb6f80eeae7f5b295fe0b70b041b45ed09
<mask token>

<mask token>
print("Enter 'x' for exit.")
<mask token>
if nval == 'x':
    exit()
else:
    rval = input('Enter value of r: ')
    n = int(nval)
    r = int(rval)
    npr = math.factorial(n) / math.factorial(n - r)
    ncr = npr / math.factorial(r)
    print('ncR =', ncr)
    print('nPr =', npr)

<mask token>
print("Enter 'x' for exit.")
nval = input('Enter value of n: ')
if nval == 'x':
    exit()
else:
    rval = input('Enter value of r: ')
    n = int(nval)
    r = int(rval)
    npr = math.factorial(n) / math.factorial(n - r)
    ncr = npr / math.factorial(r)
    print('ncR =', ncr)
    print('nPr =', npr)

import math
print("Enter 'x' for exit.")
nval = input('Enter value of n: ')
if nval == 'x':
    exit()
else:
    rval = input('Enter value of r: ')
    n = int(nval)
    r = int(rval)
    npr = math.factorial(n) / math.factorial(n - r)
    ncr = npr / math.factorial(r)
    print('ncR =', ncr)
    print('nPr =', npr)

# Python Program - Find ncR and nPr

import math;
print("Enter 'x' for exit.");
nval = input("Enter value of n: ");
if nval == 'x':
    exit();
else:
    rval = input("Enter value of r: ");
    n = int(nval);
    r = int(rval);
    npr = math.factorial(n)/math.factorial(n-r);
    ncr = npr/math.factorial(r);
    print("ncR =",ncr);
    print("nPr =",npr);
