Re: [algogeeks] Multiplication of two numbers

2010-09-20 Thread Baljeet Kumar
If a and b are the numbers then dig = log10(a) + log10(b); if dig has some fractional part then number of digits is dig + 1 else dig. On Mon, Sep 20, 2010 at 11:19 AM, sumant hegde sumant@gmail.com wrote: Adding to the partial solution, if x, y are first digits, and x*y + x + y 10, the

Re: [algogeeks] Multiplication of two numbers

2010-09-20 Thread rahul patil
On Mon, Sep 20, 2010 at 1:15 PM, Baljeet Kumar baljeetk...@gmail.comwrote: If a and b are the numbers then dig = log10(a) + log10(b); if dig has some fractional part then number of digits is dig + 1 else dig. found this correct onw On Mon, Sep 20, 2010 at 11:19 AM, sumant hegde

Re: [algogeeks] Multiplication of two numbers

2010-09-20 Thread Baljeet Kumar
@Naveen: Yes you are right, the answer is not fully correct. ans = integral part of ((log10(a)+log10(b) +1) {floor not ceiling}. On Mon, Sep 20, 2010 at 4:11 PM, Naveen Agrawal nav.coo...@gmail.comwrote: @Baljeet I think your Answer is not fully correct It should be :

[algogeeks] Multiplication of two numbers

2010-09-19 Thread Srinivas
how to find the no. of digits in the product of two numbers without multiplying?? if a is the number of digits in A and if b is the number of digits in B the number of digits in A*B is either a+b or a+b-1 but how to find the exact one? -- You received this message because you are subscribed to

Re: [algogeeks] Multiplication of two numbers

2010-09-19 Thread rahul patil
A partial solution is , if you multiply first digits of two nos and result is greater than 10 then surely result will be a+b digits If not, according to me, u will need a complex logic to solve. On Mon, Sep 20, 2010 at 10:41 AM, Srinivas lavudyasrinivas0...@gmail.comwrote: how to find the no.

Re: [algogeeks] Multiplication of two numbers

2010-09-19 Thread sumant hegde
Adding to the partial solution, if x, y are first digits, and x*y + x + y 10, the result will be a+b -1 digits. If not, u will need a complex logic to solve On Mon, Sep 20, 2010 at 10:50 AM, rahul patil rahul.deshmukhpa...@gmail.com wrote: A partial solution is , if you multiply first digits