write a c program to change only the 3rd bit of the
particular number such that other bits are not affected..
if bitnum=10(say.. it can be any no..
Answer Posted / binu
YOU CAN SET OR CLEAR THE THIRD BIT without changing other bits
#define BIT3 (0X01<<3)
void main()
{
int a;
//set the third bit of a
a|=BIT3;
//clear the third bit
a&=~BIT3;
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What do you mean by dynamic memory allocation in c? What functions are used?
What is the difference between struct and union in C?
Suggesting that there can be 62 seconds in a minute?
What is indirection? How many levels of pointers can you have?
Explain can you assign a different address to an array tag?
what is a constant pointer in C
What is a header file?
Why we use conio h in c?
What does %d do?
How can I do peek and poke in c?
What is the difference between array and linked list in c?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
Explain what are multibyte characters?
When we use void main and int main?
Describe explain how arrays can be passed to a user defined function