Seagate
Company
Numerical Ability
Age Problem
how many 4 letter words can we make from "A", "B", "C" each letter should come at least once.
and also please give a generic formula to calculate if the letters are increased.. like 5,6,7..
Read Solution (Total 1)
-
- #include
long binomial_coefficient(int k, int i)
{
unsigned long fact1, fact2;
if (i==0)
return 1;
for (fact1=1, fact2=1;i>0; k--,i--)
{
fact1 = fact1*k;
fact2 = fact2*i;
}
return fact1/fact2;
}
long power(int base, int power)
{
long result = 1;
for(;power>0;power--)
result = result * base;
return result;
}
int main()
{
int i, sum=0;
int n = 3; // Number of letters
int length = 4; // Length of the word
// Derived formula
for(i=0;i - 8 years agoHelpfull: Yes(0) No(1)
Seagate Other Question