How we can set and clear bit in a byte using macro function?
Answer Posted / sunitha
take i=5;
print its binary value
now for setting a bit
i=i>>5|1;
this will set 5th bit in binary value of 5
now for clearing a bit
i=i>>5 xor 1
this will clear 5th bit in binary value of 5
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is chain pointer in c?
Is c is a middle level language?
What is a buffer in c?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Explain 'far' and 'near' pointers in c.
Can we change the value of static variable in c?
What are the different types of C instructions?
Differentiate between a structure and a union.
Describe the steps to insert data into a singly linked list.
Why header files are used?
How is pointer initialized in c?
Do you know the use of 'auto' keyword?
What is %d used for?
Multiply an Integer Number by 2 Without Using Multiplication Operator
what is the difference between class and unio?