How we can set and clear bit in a byte using macro function?
Answer Posted / sunitha
take i=5;
print its binary value
now for setting a bit
i=i>>5|1;
this will set 5th bit in binary value of 5
now for clearing a bit
i=i>>5 xor 1
this will clear 5th bit in binary value of 5
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
In C, What is the #line used for?
What are the key features in c programming language?
What are examples of structures?
How can you find the day of the week given the date?
When a c file is executed there are many files that are automatically opened what are they files?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
How can I read and write comma-delimited text?
What is structure in c explain with example?
What is clrscr ()?
What is wrong in this statement?
How does sizeof know array size?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
How can you determine the maximum value that a numeric variable can hold?
What is calloc malloc realloc in c?