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 |
Should a function contain a return statement if it does not return a value?
Combinations of fibanocci prime series
without using arithmatic operator convert an intger variable x into x+1
how to add numbers without using arithmetic operators.
Explain goto?
write a program to generate address labels using structures?
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
main() { char x; while(x=0;x<=255;x++) printf("\nAscii value %d Charater %c",x,x); }
6)What would be the output? main() { int u=1,v=3; pf("%d%d",u,v); funct1(&u,&v); pf("%d%d\n",u,v); } void funct1(int *pu, int *pv) { *pu=0; *pv=0; return; } a)1 3 1 3 b)1 3 1 1 c)1 3 0 0 d)1 1 1 1 e) 3 1 3 1
What is the size of structure in c?
main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....
Give a fast way to multiply a number by 7
15 Answers Accenture, Aricent, Microsoft,