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 advantage of c?

1047


How do we open a binary file in Read/Write mode in C?

1175


Can we access array using pointer in c language?

1040


How does #define work?

1009


What does c mean in basketball?

940


i want to know the procedure of qualcomm for getting a job through offcampus

2409


What is a keyword?

1120


How do you determine the length of a string value that was stored in a variable?

1079


What is function prototype?

1055


Why is a semicolon (;) put at the end of every program statement?

1029


What are pointers? What are different types of pointers?

1057


What is the right type to use for boolean values in c?

988


What is a stream in c programming?

1078


Do you know what are bitwise shift operators in c programming?

1058


What is the difference between null pointer and wild pointer?

1135