Question: Write a Program to find the value of $Permutation^n$ Pr
0

Subject : Structured Programming Approach

Title : Functions and Parameter

Marks : 10M

mumbai university spa(82) • 190 views
ADD COMMENTlink
modified 12 months ago  • written 12 months ago by gravatar for Abhishek Tiwari Abhishek Tiwari ♦♦ 50
0
#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,npr;
int fact (int no);
clrscr();
printf("Enter the values of n and r:");
scanf("%d %d",&n,&r);
npr=fact(n)/fact(n-r);
printf("nPr=%d",npr);
getch();
 }
int fact (int no)
{
int i,ans;
for(i=1,ans=1;i<=no;i++)
{
    ans=ans*i;
}
return ans;
}
ADD COMMENTlink
written 12 months ago by gravatar for Abhishek Tiwari Abhishek Tiwari ♦♦ 50
Please log in to add an answer.