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 |
Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001
what is difference between declaring the pointer as int and char in c language?
What are valid operations on pointers?
20. main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); } Answer:??????
What are the advantages of external class?
input may any number except 1,output will always 1.. conditions only one variable should be declare,don't use operators,expressions,array,structure
Given a string write a program to print all alphabetical characters in the order of their occurance first,followed by the sum of the numeric characters then followed by the special characters in the order of their occurance.
1 Answers College School Exams Tests, Wipro,
Write a program to check armstrong number in c?
What is the difference between printf and scanf in c?
Explain what does the format %10.2 mean when included in a printf statement?
What is 2c dna?
What is the use of typedef in c?