Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Find nCr.
Program
echo -e "Enter n: \c"
read n
echo -e "Enter r: \c"
read r
i=2
nf=1
temp=`expr $n - $r`
tf=1
rf=1
ncr=1
while test $i -le $n
do
nf=`expr $nf\*$i`
i=`expr $i + 1`
done
nf=`echo "$nf" | bc`
while test $i -le $temp
tf=`expr $tf\*$i`
tf=`echo "$tf" | bc`
while test $i -le $r
rf=`expr $rf\*$i`
rf=`echo "$rf" | bc`
temp2=`echo "$nf / $tf" | bc`
ncr=`echo "$temp2 / $rf" | bc`
echo "nCr = $ncr"
Output
sh ncr.sh
Enter n: 5
Enter r: 4
nCr = 5
Enter n: 9
nCr = 126
Enter n: 12
Enter r: 5
nCr = 792
what is height balanced tree?
(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (
The fancy new French restaurant La Food is very popular for its authentic cuisine and high prices. This restaurant does not take reservations. To help improve the efficiency of t
Determine the moment of force about the point where a bracket is attached to a wall. the bracket is shown in figure attached. it extends 10 inched out from the wall and 5 inched up
The GuessingGame class contains a skeleton for a program to play a guessing game with the user. The program should randomly generate an integer between 1 and 10 and then ask the us
Design an object definition named Pet, which should have the following fields: name: The name field holds the name of a Pet type: The type field holds the type of anima
write a program to find the output 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 2 1 1 2 1 1
.NET Windows Services But Enthusiasm has an amazing record of beginning overdue but finding up easily. This is real in situation of .NET too. Enthusiasm put their best men at
Triple Eigenvalue with 1 Eigenvector The eigenvalue/vector pair in this case are l and ?h , . Since the eigenvalue is real we know as the first solution we require is, e l
1. Write a program that figures out how long it will take to pay off a credit card by making payments of $10 each month. Take care to avoid infinite loops. (How would a bank preven
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd