[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Bitwise Operator

Home > Programs > Bitwise Operator

343 / 15

Write an efficient program to toggle all the bits of a number except k-th bit.

Answer:

#include 
int main()
{
unsigned int n = 4294967295, k = 0;
printf("%d",~(n^(1

Asked In ::

Post Your Answer Here:

Language:

Post Your Reply Here: