int func(int x) { int y=(1<<i)+(1<<j); int z=x&y; // if after bitwise and ..we get power of 2 then ... we have to flip the bits.. if((z&(z-1))==0) return(x^y); else return x; }
With regards, Praveen Raj DCE-IT 9999735993 praveen0...@gmail.com > > -- 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?hl=en.