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
What are types of functions?
How do you use a pointer to a function?
What are the two forms of #include directive?
Why do we use main function?
What is union in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
program to convert a integer to string in c language'
How are pointers declared in c?
Explain what is a static function?
How can I do graphics in c?
What is function prototype in c language?
How can you be sure that a program follows the ANSI C standard?
What are local static variables?
Which are low level languages?
What is a built-in function in C?