though im very unsure abt this,but how abt converting the number to BCD and then normal swapping of the two nibbles?? Bt i guess this would work only for 2 digit numbers...
On Wed, Aug 24, 2011 at 8:20 PM, aditya kumar <[email protected]>wrote: > does anyone know the correct solution this problem ?? > problem : i/p :: 39 > o/p:: 93 (using bitwise operator) > > > On Fri, Aug 12, 2011 at 1:41 PM, Prakash D <[email protected]> wrote: > >> how does the above code work? >> >> >> On Fri, Aug 12, 2011 at 1:14 PM, Rahul <[email protected]> wrote: >> >>> I understand. where I find some more tricks like these , I mean I >>> really. find. bit thinking hacks. difficult to understand. >>> >>> >>> On 8/12/11, Tarun Arya <[email protected]> wrote: >>> > RAHUL@ >>> > d question was to reverse d 2 numbers...it can b done by wat i hav >>> said... >>> > if u want 2 extract numbers then.... >>> > a&0x0f //this wil giv number in units place... >>> > a&0xf0 a>>4//this wil give number in tens place >>> > >>> > correct me if i m wrong >>> > Tarun >>> > >>> > -- >>> > 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. >>> > >>> > >>> >>> >>> -- >>> Rahul >>> >>> -- >>> 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. >>> >>> >> -- >> 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. >> > > -- > 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. > -- Aditi Garg Undergraduate Student Electronics & Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- 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.
