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
One of the main strengths of the Perl programming language are its powerful text manipulation features. In this assignment, you will put them to use for writing a Perl program that
Most popular news websites publish their RSS ( Really Simple Syndication ) feeds. If you haven 't heard of RSS, you may have a look at this article on Wikipedia. In this assignm
Shemrock Inc. is a brake pad manufacturing company. This company uses raw materials, such as carbon powder, iron, ash, and resin. It wants to develop an inventory management system
Memory Hierarchy for Linux Systems A cache line has one or more valid bit(s), tag entry and list of bytes in a block in one set of a cache, as shown below: If you were
A deterministic finite automaton (DFA) is an abstract machine that reads input from a serial (nonreversible) stream and changes between a finite number of states according to the
The next major set of tasks to tackle are delete and update. Version control systems typically version updates to a ?le and only store the differences between the ?les. Two system
how to submit homework help
What is an abstract class: Abstract class is stated as an abstract concept that cannot be instantiated or comparing to interface this can have some implementation and interface c
Translate the following formula into a prefix form expression in Scheme: Question 2 Define a procedure that takes three numbers as arguments and returns the sum of the squ
Expertsmind brings you unique solution in java assignments Interfaces A program in the Java selection language is a fuzzy type that is used to specify a program (in the ge
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