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 pointer to pointer in c with example?
What are the 4 types of functions?
What is the difference between %d and %i?
What is meant by errors and debugging?
using only #include
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
What are linked lists in c?
What is the use of function overloading in C?
Can you write the algorithm for Queue?
show how link list can be used to repersent the following polynomial i) 5x+2
What does sizeof return c?
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
write a program to copy the string using switch case?
What does static variable mean in c?
What are pointers? What are different types of pointers?