2:01 PM
C++ Program of FINDING NCR FACTOR

Write a Program of FINDING NCR FACTOR

#include<iostream.h> 
#include<conio.h> 
 
void main()
{
int n,r,ncr;
clrscr();
printf("Enter any two numbers->");
scanf("%d %d",&n,&r);
ncr=fact(n)/(fact(r)*fact(n-r));
printf("The NCR factor of %d and %d is %d",n,r,ncr);
getch();
}
int fact(int n)
{
int i=1;
while(n!=0)
{
i=i*n;
n--;
}
return i;
}
 
Note:
      If you want to change in this program please write through the comment on this page. you can also past similar program 
                 of c++ with output.your comment is valuable to the other user and person.
 
Views: 92 | Added by: vijoriya | Tags: NCR, Finding, factor, c++, program | Rating: 0.0/0
Total comments: 0
avatar