To Add two integer you can use full adder at bit level. if bit1 and bit2 are kth bits and car is previous carry then
sum = bit1 ^ bit2 ^ carry; carry = bit1.carry + bit2.carry + bit1.bit2; here ^ = bitwise zor . = bitwise and + = bitwise or repeat it for all bits of two integer, initially prev carry will be 0; On Mon, Sep 7, 2009 at 7:01 AM, ritter <amar8...@gmail.com> wrote: > > how to add two integers without using arithmetic operators? > can anyone help me. > > > > -- GAURAV GUPTA B.Tech IV Yr. , Department of Computer Science & Engineering IT BHU , Varanasi Contacts Phone No: +91-99569-49491 e-mail : gaurav.gu...@acm.org gaurav.gupta.cs...@itbhu.ac.in --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---