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...

# 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 ( );
}

Related

C Programs 8410380503550881485

Post a Comment

emo-but-icon

item