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
List a few unconditional control statement in c.
What is an auto keyword in c?
Tell us two differences between new () and malloc ()?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What are file streams?
What is scanf_s in c?
Write a code to generate divisors of an integer?
What is a far pointer in c?
Explain how can I open a file so that other programs can update it at the same time?
Explain how do you list files in a directory?
What is the difference between %d and %i?
what are # pragma staments?
what is the height of tree if leaf node is at level 3. please explain
Are c and c++ the same?
What is scope rule in c?