HOME

Start

Control Statements

Array

Function

Structure

Pointer

File

Projects

 

 

 

 

 

 

C programing

Ckalari.com is the No.1 website to get the best of C programs, free source codes, projects in c language……  

A C program to find the value of ncr

#include<stdio.h>

#include<conio.h>

int fact(int x);

void main()

     {

    int n,r,ncr;

    clrscr();

    printf("\nEnter the value of N and R\n");

    scanf("%d%d",&n,&r); p

    ncr=fact(n)/(fact(r)*fact(n-r));

    printf("\nOur answer is:: %d",ncr);

    getch();

     }

int fact(int x)

     {

    int f=1,i;

    if(x==0)

        {

      return(f);

        }

    else

    {

      for(i=1;i<=x;i++)

      {

        f=f*i;

      }

      return(f);

    }

     }

 

Copyright © 2007-2008 www.ckalari.com