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
Explain what does a function declared as pascal do differently?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What are the keywords in c?
What is difference between array and structure in c?
What is the difference between āgā and āgā in C?
Explain the advantages and disadvantages of macros.
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
how to count no of words,characters,lines in a paragraph.
Why is structure important for a child?
What is the advantage of c?
Why we use void main in c?
Is struct oop?
Is main is user defined function?
Explain what is a pragma?