C program to calculate and print the value of nPr

#include <stdio.h> void main() { int n, r, npr_var; printf(“Enter the value of n:”); scanf(“%d”, &n); printf(“\nEnter the value of r:”); scanf(“%d”, &r); /* nPr is also known as P(n,r), the formula is: * P(n,r) = n! / (n – r)! For 0 <= r <= n. */ npr_var = fact(n) / fact(n – r); … Read more