Write A Program for calculating NCR value
# include<stdio.h> #include<conio.h> void main ( ) { int n, r, ncr, a, b, c, i; clrscr ( ) ; a = b = c...
https://www.computersprofessor.com/2016/06/write-program-for-calculating-ncr-value.html?m=0
# include<stdio.h>
#include<conio.h>
void main ( )
{
int n, r, ncr, a, b, c, i;
clrscr ( ) ;
a = b = c = 1;
printf ( “enter n, r values”);
scanf ("%d%d”, & n , & r);
for ( i = 1; i <= n; i++)
a = a*i;
for ( i = 1; i <= r; i++)
b = b *i;
for ( i = 1; i < = ( n-r); i++)
c= c*i;
ncr = a/b*c;
printf (“\n NCR value is % d”, ncr);
getch ( );
}