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 to set Nth bit of variable by using MACRO

Answer Posted / kirankumaryakkala

#define set(val,n) val|=1<<n //do left-shift then bitwise OR

logic is val|=1<<n
means,
first shift the value 1 to ntimes and do the bitwise or with
value.
u will get the answer

Is This Answer Correct ?    30 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1033


What are two dimensional arrays alternatively called as?

1132


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1860


How can I do peek and poke in c?

1037


What is the code in while loop that returns the output of given code?

1895


Why we write conio h in c?

963


Create a simple code fragment that will swap the values of two variables num1 and num2.

1236


What is static identifier?

1165


What is enumerated data type in c?

1030


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1953


How do you initialize pointer variables?

1030


Why is c so powerful?

1064


Combinations of fibanocci prime series

1555


What is your stream meaning?

1126


what are non standard function in c

1848