you can try this...... int add(int x, int y) { if (!x) return y; else return add((x & y) << 1, x ^ y); }
On Sep 7, 4:01 pm, ritter <amar8...@gmail.com> wrote: > how to add two integers without using arithmetic operators? > can anyone help me. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---