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

How can you tell whether a program was compiled using c versus c++?

0 Answers  


What is echo in c programming?

0 Answers  


Program to find larger of the two numbers without using if-else,while,for,switch

11 Answers   iNautix, Wipro,


For what purpose null pointer used?

0 Answers  


What is a class?

3 Answers  






i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


What is a static function in c?

0 Answers  


State the difference between x3 and x[3].

0 Answers   Aricent,


what are # pragma staments?

0 Answers  


i want to job in your company, so how it will be possible.

3 Answers   TCS,


Can i use “int” data type to store the value 32768? Why?

0 Answers  


Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


Categories