public class Client {
public static void main(String[] args) {
BigInteger a[]= new BigInteger[1010];
a[0]=BigInteger.ONE;
a[1]=BigInteger.ONE;
for(int i=2;i<1010;i++)
{
String f="";
f=f+i;
a[i]=a[i-1].multiply(BigInteger.valueOf(i));
}
//System.out.println(a[5]);
// so in the array a are stored all values of
factorial
}
}
a[0]=1;
a[1]=1;
On Sep 25, 4:16 pm, सारंग <[email protected]> wrote:
> Hello Agaly,
> Use mathematics and its Formula that is n! (n Factorial);
> double product = 0.0;
> Object O = new Object(); // U can use java.lang.Float as direct object data
> type of float data type.
> O.factorial(1000);
>
> double Factorial(double number){
> if(number ==0 || number == 1)
> return 1;
> else
> return(number * (Factorial (number-1))
>
> }
>
> * Please let me know anyone is having more efficient way solving this
> problem.
>
> Thanks and Regards
> Sarang Gandhi
>
> On Sun, Sep 25, 2011 at 6:19 AM, Agaly Rahmanov
> <[email protected]>wrote:
>
>
>
>
>
>
>
> > Can you answer to this question?
>
> > 1. Write Java variable declaration
>
> > Declare a variable to store a product number (1-1000)
>
> > __________________________________________________
>
> > --
> > To post to this group, send email to
> > [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> >http://groups.google.com/group/javaprogrammingwithpassion?hl=en
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en