Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1148


What is a dynamic array in c?

1225


Can we use visual studio for c?

1162


What are local variables c?

1071


What library is sizeof in c?

1142


What is union and structure?

1195


What is a pointer variable in c language?

1155


Why isn't it being handled properly?

1122


What are 3 types of structures?

1106


Explain what are header files and explain what are its uses in c programming?

1201


What is difference between static and global variable in c?

1103


Which is better between malloc and calloc?

1254


What is data type long in c?

1116


What is wrong with this statement? Myname = 'robin';

1393


How are variables declared in c?

1151