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

Differentiate Source Codes from Object Codes

824


What is the difference between the = symbol and == symbol?

631


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

681


Is main a keyword in c?

635


Can you explain the four storage classes in C?

646






Why pointers are used?

633


What is the purpose of sprintf() function?

607


Is it possible to pass an entire structure to functions?

563


Difference between constant pointer and pointer to a constant.

615


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

669


Why is struct padding needed?

635


What are pointers really good for, anyway?

620


What is a constant?

637


a value that does not change during program execution a) variabe b) argument c) parameter d) none

699


What is an example of structure?

591