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
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Does free set pointer to null?
How can I ensure that integer arithmetic doesnt overflow?
#include
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
What are actual arguments?
Why is this loop always executing once?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Is c is a high level language?
What is array in C
List out few of the applications that make use of Multilinked Structures?
What are directives in c?
What is an auto variable in c?
What are the applications of c language?
What is data structure in c language?