how to set Nth bit of variable by using MACRO
Answer Posted / kirankumaryakkala
#define set(val,n) val|=1<<n //do left-shift then bitwise OR
logic is val|=1<<n
means,
first shift the value 1 to ntimes and do the bitwise or with
value.
u will get the answer
| Is This Answer Correct ? | 30 Yes | 6 No |
Post New Answer View All Answers
how can f be used for both float and double arguments in printf? Are not they different types?
What are the 5 organizational structures?
Explain the red-black trees?
Why does the call char scanf work?
Why c is called a mid level programming language?
Explain the difference between malloc() and calloc() function?
write a program to print data of 5 five students with structures?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
Why is this loop always executing once?
How can this be legal c?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
How to find a missed value, if you want to store 100 values in a 99 sized array?
Does c have circular shift operators?
What are the 4 data types?