You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bbswork...@googlegroups.com
hello friends.. hope u are enjoying diwali..we have found our last class(bitwise and switch-case) was very much intractive..i am going to attach some of good questions on bitwise which is frequently asked in technical interview..
1) Write an efficient program to count number of 1s in binary
representation of an integer.
2)Wap which returns greater and lesser than given no which is power of 2..ex:for input 47,lesser sud be 32 and greater sud be 64..
3)Mutiply with (5,7,3,3.5) to given no..using only bitwise..
4)Given an array of positive integers. All numbers occur even number of
times except one number which occurs odd number of times. Find the
number in O(n) time & constant space.
5)Write a C function that unsets the rightmost set bit of an integer..
6)ADD 1 to a given no. without using arithmatic operator..
we have more stuffs on bitwise,which we'll discuss after diwali...
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bbswork...@googlegroups.com
actually masking is used set or unset the bits of a number...we can use mask depending on the situation.. example...suppose we have a number n=27 or in binary n=11011 and we want to set bit 3rd from right.. we'll do n | 100 which will result 11111.. now if we want to unset bit 3rd... n&11...1111011 which will result 11011.. there are many uses of masking in aplication of digital communications..