Wonder if this works:

x = A / 10^(a-1)  // take it as a decimal value itself
y = B / 10^(b-1) // take it as a decimal value itself
if x * y >= 10.0
  return (a+b)
else
  return (a+b-1)

One advantage of the above method is that it can be done mentally.

On Sep 20, 10:47 am, Dave <[email protected]> wrote:
> @Rahul. No. Considering your example 33*30, x*y + x + y = 3*3 + 3 + 3
> = 15 is not < 10, so, as specified by Sumant, "u will need a complex
> logic to solve".
>
> Dave
>
> On Sep 20, 5:31 am, rahul patil <[email protected]> wrote:
>
>
>
> > On Mon, Sep 20, 2010 at 1:15 PM, Baljeet Kumar <[email protected]>wrote:
>
> > > 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 
> > > <[email protected]>wrote:
>
> > >> 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"
>
> > if we take 30 *  33 as an example then it is (3*3 + 3+3 )> 10  which says
> > ans will be 4 digit
> > but ans is 990 which is 3 digit.
>
> > >> On Mon, Sep 20, 2010 at 10:50 AM, rahul patil <
> > >> [email protected]> wrote:
>
> > >>> 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 <
> > >>> [email protected]> wrote:
>
> > >>>> 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 the Google
> > >>>> Groups "Algorithm Geeks" group.
> > >>>> To post to this group, send email to [email protected].
> > >>>> To unsubscribe from this group, send email to
> > >>>> [email protected]<algogeeks%2bunsubscr...@googlegroups
> > >>>>  ­.com>
> > >>>> .
> > >>>> For more options, visit this group at
> > >>>>http://groups.google.com/group/algogeeks?hl=en.
>
> > >>> --
> > >>> Regards,
> > >>> Rahul Patil
>
> > >>>  --
> > >>> You received this message because you are subscribed to the Google 
> > >>> Groups
> > >>> "Algorithm Geeks" group.
> > >>> To post to this group, send email to [email protected].
> > >>> To unsubscribe from this group, send email to
> > >>> [email protected]<algogeeks%2bunsubscr...@googlegroups
> > >>>  ­.com>
> > >>> .
> > >>> For more options, visit this group at
> > >>>http://groups.google.com/group/algogeeks?hl=en.
>
> > >>  --
> > >> You received this message because you are subscribed to the Google Groups
> > >> "Algorithm Geeks" group.
> > >> To post to this group, send email to [email protected].
> > >> To unsubscribe from this group, send email to
> > >> [email protected]<algogeeks%2bunsubscr...@googlegroups
> > >>  ­.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/algogeeks?hl=en.
>
> > >  --
> > > You received this message because you are subscribed to the Google Groups
> > > "Algorithm Geeks" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<algogeeks%2bunsubscr...@googlegroups
> > >  ­.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/algogeeks?hl=en.
>
> > --
> > Regards,
> > Rahul Patil- Hide quoted text -
>
> > - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
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/algogeeks?hl=en.

Reply via email to