How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST
Answers were Sorted based on User's Feedback
Answer / narendra
#define TURN_OFF_BIT_LAST(x) ((~0) >> 1) & x)
in the question it is asking to clear MSB not LSB
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / manoj
#define TURN_OFF_BIT_LAST(x) ((x) & 1) ? ((x) &= ((~0) <<
1)):(x)=(x)
Is This Answer Correct ? | 0 Yes | 2 No |
Explain what is the difference between declaring a variable and defining a variable?
Meaning of () in c
What is Full Form of C and Why We use C
What is dynamic memory allocation?
What is bss in c?
What is the best organizational structure?
What Is The Difference Between Null And Void Pointer?
Write a program to print the prime numbers from 1 to 100?
What is the Purpose of 'extern' keyword in a function declaration?
What functions are in conio h?
What is null character in c?
what is a c-language.what is do.