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 the difference between null pointer and void pointer.
What are directives in c?
What is the proper way of these job Tell me about there full work
what does ‘#include’ mean?
What is your favorite subject?
1 Answers Ericsson, Invendis, Tech Mahindra,
how can we Declare a variable in c without defining it.
Explain what are the different data types in c?
What is a loop?
What is the explanation for cyclic nature of data types in c?
what will happen if you free a pointer twice after allocating memory dynamically ?
logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............
How can I determine whether a machines byte order is big-endian or little-endian?