What's New-Given Below
technicalsymposium
technicalsymposium
technicalsymposium

C/C++ Lab Program(s)/Materials

C Program For NCR VALUE BY RECURSIVE FUNCTION.

#include<stdio.h>
#include<conio.h>
void main()
{
int n,r,ncr;
clrscr();
printf("Enter the n and r value:");
scanf("%d%d",&n,&r);
ncr=fact(n)/((fact(r))*(fact(n-r)));
printf("n=%d\n",fact(n));
printf("r=%d\n",fact(r));
printf("n-r=%d\n",fact(n-r));
printf("the ncr =%d\n",ncr);
getch();
}
int fact(int a)
{
int c=1,i;
for(i=1;i<=a;i++)
{
c=c*i;
}
return(c);
}

More Lab Programs with Answers -Given Below-Click and Get Freely

Hosting by Yahoo!

About-Us    Contact-Us    Site-map

©copyright 2009 All rights are reserved to technicalsymposium.com