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
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
What are type modifiers in c?
What should malloc() do?
Can main () be called recursively?
What are the types of data structures in c?
What is clrscr in c?
what are bit fields? What is the use of bit fields in a structure declaration?
What does do in c?
What are qualifiers and modifiers c?
How do you define CONSTANT in C?
Write a program to print numbers from 1 to 100 without using loop in c?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
What is the difference between c &c++?
What is New modifiers?
How can I pad a string to a known length?