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
can anyone please tell about the nested interrupts?
Why does the call char scanf work?
What is pointer to pointer in c with example?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What do you mean by Recursion Function?
What is a protocol in c?
What are the applications of c language?
How can I implement sets or arrays of bits?
What is c method?
How are Structure passing and returning implemented by the complier?
Is int a keyword in c?
Explain what are header files and explain what are its uses in c programming?
How can I discover how many arguments a function was actually called with?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Write a program that accept anumber in words