C Program to find the value of n-c-r
integer n,r,i
real ncr
write(*,*)'Enter the Positive integers n,r:'
read(*,*)n,r
ncr=fact(n)/(fact(r)*fact(n-r))
write(*,*)'The value of ncr is',ncr
end
C Program sub function
function fact(n)
fact=1
do i=1,n
fact=fact*i
end do
return
end
integer n,r,i
real ncr
write(*,*)'Enter the Positive integers n,r:'
read(*,*)n,r
ncr=fact(n)/(fact(r)*fact(n-r))
write(*,*)'The value of ncr is',ncr
end
C Program sub function
function fact(n)
fact=1
do i=1,n
fact=fact*i
end do
return
end
Comments
Post a Comment