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

write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

4017


Explain pointers in c programming?

1161


Was 2000 a leap year?

1091


explain how do you use macro?

1209


what is the significance of static storage class specifier?

2345


Tell us the use of fflush() function in c language?

1203


How can I determine whether a machines byte order is big-endian or little-endian?

1124


What does 4d mean in c?

1562


What is meant by type casting?

1106


how to construct a simulator keeping the logical boolean gates in c

2305


How do you generate random numbers in C?

1246


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1599


Write a program to print “hello world” without using semicolon?

1185


What is the difference between a function and a method in c?

1135


What do you mean by command line argument?

1228