Subtract two numbers without using arithmetic operators | Java Program to subtract two Number without using arithmetic operator Recursive implementation . ; Driver program
class GFG { static int subtract ( int x , int y ) { if ( y == 0 ) return x ; return subtract ( x ^ y , ( ~ x & y ) << 1 ) ; } public static void main ( String [ ] args ) { int x = 29 , y = 13 ; System . out . printf ( " x ▁ - ▁ y ▁ is ▁ % d " , subtract ( x , y ) ) ; } }