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 is use of null pointer in c?
Write a program to print numbers from 1 to 100 without using loop in c?
how to build a exercise findig min number of e heap with list imlemented?
Explain what are run-time errors?
Explain what are the standard predefined macros?
What is the difference between local variable and global variable in c?
What is the use of ?: Operator?
What does s c mean in text?
What is const volatile variable in c?
What is getch?
What is the size of structure pointer in c?
write a c program to find the sum of five entered numbers using an array named number
Why do we use int main instead of void main in c?
What is scope rule of function in c?
What is declaration and definition in c?