Write a C program to find the value of nPr, n and r are taken from the keyboard
#include <stdio.h>
main()
{
int n,r;
float f;
printf("Enter the values of N and R:\n");
scanf("%d%d",&n,&r);
f=fact(n)/fact(n-r);
printf("nPr values is : %5.2f",f);
getch();
}
fact(int n)
{
int i,f=1;
for (i=1; i<=n; i++)
f=f*i;
return(f);
}
can you give this solve without using function plzz.....
ReplyDeleteThe code doesn't work properly
ReplyDelete