Write a program to replace n bits from the position p of
the bit representation of an inputted character x with the
one's complement. Method invertBit takes 3 parameters x as
input character, p as position and n as the number of
positions from p. Replace n bits from pth position in 8 bit
character x. Then return the characters by inverting the
bits.


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Interview Questions

FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY?

4 Answers   Wipro,


What are external variables in c?

0 Answers  


what r the cpu registers r ther?

1 Answers  


Explain what is a pragma?

0 Answers  


Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

4 Answers   TCS,


I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....

2 Answers  


write a program structure to find average of given number

1 Answers  


How is a macro different from a function?

0 Answers   Tech Mahindra,


Give basis knowledge of web designing ...

0 Answers   HCL,


what does ‘#include’ mean?

1 Answers   TCS,


Why do we use namespace feature?

0 Answers  


please send me the code for multiplying sparse matrix using c

0 Answers  


Categories