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 |
how to print "hai" in c?
Write a program to find given number is even or odd without using any control statement.
What is an expression?
1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.
I have a function which accepts, and is supposed to initialize,a pointer, but the pointer in the caller remains unchanged.
find second largest element in array w/o using sorting techniques? use onle one for loop.
15 Answers BitWise, Zycus Infotech,
what are advantages of U D F?
How to develop software using "c" programming?
What does volatile do?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Why the use of alloca() is discouraged?
#define min((a),(b)) ((a)<(b))?(a):(b) main() { int i=0,a[20],*ptr; ptr=a; while(min(ptr++,&a[9])<&a[8]) i=i+1; printf("i=%d\n",i);}