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...

Toggle nth bit in a given integer - num

Answer Posted / sahil

num=num ^ (1<<(n-1));

Is This Answer Correct ?    51 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a code of a general series where the next element is the sum of last k terms.

1014


How can I direct output to the printer?

1296


Can we declare a function inside a function in c?

1011


What are examples of structures?

1061


There seem to be a few missing operators ..

1027


What happens if a header file is included twice?

1008


What is restrict keyword in c?

1078


What are runtime error?

1104


Is void a keyword in c?

952


Write a program to print "hello world" without using a semicolon?

1037


What are near, far and huge pointers?

1034


What is the difference between char array and char pointer?

1016


Is c procedural or functional?

997


What are the rules for the identifier?

1135


Write a program to print factorial of given number without using recursion?

972