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
Do you have any idea how to compare array with pointer in c?
What is the difference between class and object in c?
What is the correct code to have following output in c using nested for loop?
Write a program of advanced Fibonacci series.
Is c procedural or object oriented?
What is sizeof c?
What do mean by network ?
What are the different data types in C?
Explain what are the advantages and disadvantages of a heap?
Can a pointer point to null?
How does free() know explain how much memory to release?
State two uses of pointers in C?
What is pointer in c?
Why is main function so important?
What is a macro, and explain how do you use it?