Toggle nth bit in a given integer - num

Answer Posted / qint

num ^ (1 << n)

Is This Answer Correct ?    31 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of function overloading in C?

677


What is structure padding in c?

622


List the difference between a "copy constructor" and a "assignment operator"?

579


What is sorting in c plus plus?

564


What are the advantages and disadvantages of a heap?

705






Write a code on reverse string and its complexity.

606


Explain two-dimensional array.

625


Mention four important string handling functions in c languages .

620


When the macros gets expanded?

783


write a program to find the given number is prime or not

3838


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

643


What is the explanation for prototype function in c?

566


Is there a way to jump out of a function or functions?

632


What is this pointer in c plus plus?

592


What is data structure in c language?

600