View Single Post
  #1 (permalink)  
Old October 17th, 2007, 03:43 PM
deepak.deemca deepak.deemca is offline
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please give me solution

Hi! friends
Please give me solution of this object
create a function invert(int x,int y,int n)
with n bits.That began at position inverted p.
you have to assume that x,p,n are integer and function will return an integer.
Ex.if x=181 in decimal , which is 10110101 in binary. and p=4, n=2.
then function will return 10101101 in binary and 173 in decimal.
the underlined bits are managed bits.
note that bit position counted from right to keft that count start with zero. therefore position 4 is fifth bit from right value.

Deepak Singh
Reply With Quote