write a c program to change only the 3rd bit of the
particular number such that other bits are not affected..
if bitnum=10(say.. it can be any no..
Answer Posted / binu
YOU CAN SET OR CLEAR THE THIRD BIT without changing other bits
#define BIT3 (0X01<<3)
void main()
{
int a;
//set the third bit of a
a|=BIT3;
//clear the third bit
a&=~BIT3;
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is type qualifiers?
What does dm mean sexually?
How many parameters should a function have?
What is the difference between c and python?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is #define in c?
Is javascript based on c?
What are the advantages of c preprocessor?
how to create duplicate link list using C???
What is the usage of the pointer in c?
What is void c?
formula to convert 2500mmh2o into m3/hr
difference between object file and executable file
How can I swap two values without using a temporary?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?